From b9104016e8e0a44627389353f9ab0befc3a0182e Mon Sep 17 00:00:00 2001 From: ZiWei Chen <98569699+kazrael2119@users.noreply.github.com> Date: Tue, 19 Nov 2024 19:14:05 +0800 Subject: [PATCH] [mgmt] ConnectedCache release (#31831) https://github.com/Azure/sdk-release-request/issues/5698 --- .github/CODEOWNERS | 3 + common/config/rush/pnpm-lock.yaml | 42 +- eng/ignore-links.txt | 1 + rush.json | 5 + .../arm-connectedcache/CHANGELOG.md | 7 + sdk/connectedcache/arm-connectedcache/LICENSE | 21 + .../arm-connectedcache/README.md | 102 + .../arm-connectedcache/api-extractor.json | 18 + .../arm-connectedcache/assets.json | 6 + .../arm-connectedcache/eslint.config.mjs | 17 + .../arm-connectedcache/package.json | 160 ++ .../review/arm-connectedcache-models.api.md | 441 +++++ .../review/arm-connectedcache.api.md | 723 +++++++ .../arm-connectedcache/sample.env | 1 + ...acheNodesOperationsCreateorUpdateSample.ts | 38 + .../cacheNodesOperationsDeleteSample.ts | 27 + .../cacheNodesOperationsGetSample.ts | 28 + ...odesOperationsListByResourceGroupSample.ts | 29 + ...NodesOperationsListBySubscriptionSample.ts | 29 + .../cacheNodesOperationsUpdateSample.ts | 27 + ...eCustomerOperationsCreateOrUpdateSample.ts | 34 + ...nterpriseCustomerOperationsDeleteSample.ts | 27 + .../enterpriseCustomerOperationsGetSample.ts | 25 + ...omerOperationsListByResourceGroupSample.ts | 31 + ...tomerOperationsListBySubscriptionSample.ts | 29 + ...nterpriseCustomerOperationsUpdateSample.ts | 29 + ...acheNodesOperationsCreateOrUpdateSample.ts | 73 + ...riseMccCacheNodesOperationsDeleteSample.ts | 28 + ...rationsGetCacheNodeInstallDetailsSample.ts | 29 + ...erpriseMccCacheNodesOperationsGetSample.ts | 29 + ...stByEnterpriseMccCustomerResourceSample.ts | 32 + ...riseMccCacheNodesOperationsUpdateSample.ts | 30 + ...erpriseMccCustomersCreateOrUpdateSample.ts | 64 + .../enterpriseMccCustomersDeleteSample.ts | 24 + .../enterpriseMccCustomersGetSample.ts | 28 + ...seMccCustomersListByResourceGroupSample.ts | 29 + ...iseMccCustomersListBySubscriptionSample.ts | 29 + .../enterpriseMccCustomersUpdateSample.ts | 27 + ...acheNodesOperationsCreateOrUpdateSample.ts | 73 + .../ispCacheNodesOperationsDeleteSample.ts | 28 + ...spCacheNodesOperationsGetBgpCidrsSample.ts | 29 + ...rationsGetCacheNodeInstallDetailsSample.ts | 29 + .../ispCacheNodesOperationsGetSample.ts | 29 + ...erationsListByIspCustomerResourceSample.ts | 32 + .../ispCacheNodesOperationsUpdateSample.ts | 30 + .../ispCustomersCreateOrUpdateSample.ts | 60 + .../samples-dev/ispCustomersDeleteSample.ts | 27 + .../samples-dev/ispCustomersGetSample.ts | 25 + .../ispCustomersListByResourceGroupSample.ts | 29 + .../ispCustomersListBySubscriptionSample.ts | 29 + .../samples-dev/ispCustomersUpdateSample.ts | 27 + .../samples-dev/operationsListSample.ts | 29 + .../samples/v1-beta/javascript/README.md | 124 ++ ...acheNodesOperationsCreateorUpdateSample.js | 38 + .../cacheNodesOperationsDeleteSample.js | 27 + .../cacheNodesOperationsGetSample.js | 28 + ...odesOperationsListByResourceGroupSample.js | 29 + ...NodesOperationsListBySubscriptionSample.js | 29 + .../cacheNodesOperationsUpdateSample.js | 27 + ...eCustomerOperationsCreateOrUpdateSample.js | 34 + ...nterpriseCustomerOperationsDeleteSample.js | 27 + .../enterpriseCustomerOperationsGetSample.js | 25 + ...omerOperationsListByResourceGroupSample.js | 31 + ...tomerOperationsListBySubscriptionSample.js | 29 + ...nterpriseCustomerOperationsUpdateSample.js | 29 + ...acheNodesOperationsCreateOrUpdateSample.js | 73 + ...riseMccCacheNodesOperationsDeleteSample.js | 28 + ...rationsGetCacheNodeInstallDetailsSample.js | 29 + ...erpriseMccCacheNodesOperationsGetSample.js | 29 + ...stByEnterpriseMccCustomerResourceSample.js | 32 + ...riseMccCacheNodesOperationsUpdateSample.js | 30 + ...erpriseMccCustomersCreateOrUpdateSample.js | 64 + .../enterpriseMccCustomersDeleteSample.js | 24 + .../enterpriseMccCustomersGetSample.js | 28 + ...seMccCustomersListByResourceGroupSample.js | 29 + ...iseMccCustomersListBySubscriptionSample.js | 29 + .../enterpriseMccCustomersUpdateSample.js | 27 + ...acheNodesOperationsCreateOrUpdateSample.js | 73 + .../ispCacheNodesOperationsDeleteSample.js | 28 + ...spCacheNodesOperationsGetBgpCidrsSample.js | 29 + ...rationsGetCacheNodeInstallDetailsSample.js | 29 + .../ispCacheNodesOperationsGetSample.js | 29 + ...erationsListByIspCustomerResourceSample.js | 32 + .../ispCacheNodesOperationsUpdateSample.js | 30 + .../ispCustomersCreateOrUpdateSample.js | 60 + .../javascript/ispCustomersDeleteSample.js | 27 + .../javascript/ispCustomersGetSample.js | 25 + .../ispCustomersListByResourceGroupSample.js | 29 + .../ispCustomersListBySubscriptionSample.js | 29 + .../javascript/ispCustomersUpdateSample.js | 27 + .../javascript/operationsListSample.js | 29 + .../samples/v1-beta/javascript/package.json | 33 + .../samples/v1-beta/javascript/sample.env | 1 + .../samples/v1-beta/typescript/README.md | 137 ++ .../samples/v1-beta/typescript/package.json | 42 + .../samples/v1-beta/typescript/sample.env | 1 + ...acheNodesOperationsCreateorUpdateSample.ts | 38 + .../src/cacheNodesOperationsDeleteSample.ts | 27 + .../src/cacheNodesOperationsGetSample.ts | 28 + ...odesOperationsListByResourceGroupSample.ts | 31 + ...NodesOperationsListBySubscriptionSample.ts | 29 + .../src/cacheNodesOperationsUpdateSample.ts | 29 + ...eCustomerOperationsCreateOrUpdateSample.ts | 38 + ...nterpriseCustomerOperationsDeleteSample.ts | 27 + .../enterpriseCustomerOperationsGetSample.ts | 28 + ...omerOperationsListByResourceGroupSample.ts | 31 + ...tomerOperationsListBySubscriptionSample.ts | 29 + ...nterpriseCustomerOperationsUpdateSample.ts | 29 + ...acheNodesOperationsCreateOrUpdateSample.ts | 75 + ...riseMccCacheNodesOperationsDeleteSample.ts | 28 + ...rationsGetCacheNodeInstallDetailsSample.ts | 30 + ...erpriseMccCacheNodesOperationsGetSample.ts | 29 + ...stByEnterpriseMccCustomerResourceSample.ts | 32 + ...riseMccCacheNodesOperationsUpdateSample.ts | 30 + ...erpriseMccCustomersCreateOrUpdateSample.ts | 64 + .../src/enterpriseMccCustomersDeleteSample.ts | 24 + .../src/enterpriseMccCustomersGetSample.ts | 28 + ...seMccCustomersListByResourceGroupSample.ts | 31 + ...iseMccCustomersListBySubscriptionSample.ts | 29 + .../src/enterpriseMccCustomersUpdateSample.ts | 29 + ...acheNodesOperationsCreateOrUpdateSample.ts | 73 + .../ispCacheNodesOperationsDeleteSample.ts | 28 + ...spCacheNodesOperationsGetBgpCidrsSample.ts | 29 + ...rationsGetCacheNodeInstallDetailsSample.ts | 30 + .../src/ispCacheNodesOperationsGetSample.ts | 29 + ...erationsListByIspCustomerResourceSample.ts | 32 + .../ispCacheNodesOperationsUpdateSample.ts | 30 + .../src/ispCustomersCreateOrUpdateSample.ts | 64 + .../src/ispCustomersDeleteSample.ts | 27 + .../typescript/src/ispCustomersGetSample.ts | 28 + .../ispCustomersListByResourceGroupSample.ts | 31 + .../ispCustomersListBySubscriptionSample.ts | 29 + .../src/ispCustomersUpdateSample.ts | 29 + .../typescript/src/operationsListSample.ts | 29 + .../samples/v1-beta/typescript/tsconfig.json | 17 + .../src/api/cacheNodesOperations/index.ts | 338 ++++ .../src/api/connectedCacheContext.ts | 57 + .../api/enterpriseCustomerOperations/index.ts | 350 ++++ .../index.ts | 393 ++++ .../src/api/enterpriseMccCustomers/index.ts | 348 ++++ .../arm-connectedcache/src/api/index.ts | 98 + .../src/api/ispCacheNodesOperations/index.ts | 438 +++++ .../src/api/ispCustomers/index.ts | 326 ++++ .../src/api/operations/index.ts | 53 + .../arm-connectedcache/src/api/options.ts | 155 ++ .../src/classic/cacheNodesOperations/index.ts | 135 ++ .../enterpriseCustomerOperations/index.ts | 143 ++ .../index.ts | 177 ++ .../classic/enterpriseMccCustomers/index.ts | 140 ++ .../arm-connectedcache/src/classic/index.ts | 10 + .../classic/ispCacheNodesOperations/index.ts | 198 ++ .../src/classic/ispCustomers/index.ts | 121 ++ .../src/classic/operations/index.ts | 26 + .../src/connectedCacheClient.ts | 88 + .../src/helpers/serializerHelpers.ts | 36 + .../arm-connectedcache/src/index.ts | 115 ++ .../arm-connectedcache/src/logger.ts | 5 + .../arm-connectedcache/src/models/index.ts | 56 + .../arm-connectedcache/src/models/models.ts | 1735 +++++++++++++++++ .../src/restorePollerHelpers.ts | 216 ++ .../src/static-helpers/pagingHelpers.ts | 241 +++ .../src/static-helpers/pollingHelpers.ts | 126 ++ .../connectedcache_operations_test.spec.ts | 46 + .../test/public/utils/recordedClient.ts | 23 + .../tsconfig.browser.config.json | 10 + .../arm-connectedcache/tsconfig.json | 18 + .../arm-connectedcache/tsp-location.yaml | 4 + .../vitest.browser.config.ts | 38 + .../arm-connectedcache/vitest.config.ts | 34 + sdk/connectedcache/ci.mgmt.yml | 32 + 170 files changed, 12013 insertions(+), 1 deletion(-) create mode 100644 sdk/connectedcache/arm-connectedcache/CHANGELOG.md create mode 100644 sdk/connectedcache/arm-connectedcache/LICENSE create mode 100644 sdk/connectedcache/arm-connectedcache/README.md create mode 100644 sdk/connectedcache/arm-connectedcache/api-extractor.json create mode 100644 sdk/connectedcache/arm-connectedcache/assets.json create mode 100644 sdk/connectedcache/arm-connectedcache/eslint.config.mjs create mode 100644 sdk/connectedcache/arm-connectedcache/package.json create mode 100644 sdk/connectedcache/arm-connectedcache/review/arm-connectedcache-models.api.md create mode 100644 sdk/connectedcache/arm-connectedcache/review/arm-connectedcache.api.md create mode 100644 sdk/connectedcache/arm-connectedcache/sample.env create mode 100644 sdk/connectedcache/arm-connectedcache/samples-dev/cacheNodesOperationsCreateorUpdateSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples-dev/cacheNodesOperationsDeleteSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples-dev/cacheNodesOperationsGetSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples-dev/cacheNodesOperationsListByResourceGroupSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples-dev/cacheNodesOperationsListBySubscriptionSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples-dev/cacheNodesOperationsUpdateSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseCustomerOperationsCreateOrUpdateSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseCustomerOperationsDeleteSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseCustomerOperationsGetSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseCustomerOperationsListByResourceGroupSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseCustomerOperationsListBySubscriptionSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseCustomerOperationsUpdateSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseMccCacheNodesOperationsCreateOrUpdateSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseMccCacheNodesOperationsDeleteSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseMccCacheNodesOperationsGetCacheNodeInstallDetailsSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseMccCacheNodesOperationsGetSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseMccCacheNodesOperationsListByEnterpriseMccCustomerResourceSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseMccCacheNodesOperationsUpdateSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseMccCustomersCreateOrUpdateSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseMccCustomersDeleteSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseMccCustomersGetSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseMccCustomersListByResourceGroupSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseMccCustomersListBySubscriptionSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseMccCustomersUpdateSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples-dev/ispCacheNodesOperationsCreateOrUpdateSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples-dev/ispCacheNodesOperationsDeleteSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples-dev/ispCacheNodesOperationsGetBgpCidrsSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples-dev/ispCacheNodesOperationsGetCacheNodeInstallDetailsSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples-dev/ispCacheNodesOperationsGetSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples-dev/ispCacheNodesOperationsListByIspCustomerResourceSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples-dev/ispCacheNodesOperationsUpdateSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples-dev/ispCustomersCreateOrUpdateSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples-dev/ispCustomersDeleteSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples-dev/ispCustomersGetSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples-dev/ispCustomersListByResourceGroupSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples-dev/ispCustomersListBySubscriptionSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples-dev/ispCustomersUpdateSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples-dev/operationsListSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/README.md create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/cacheNodesOperationsCreateorUpdateSample.js create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/cacheNodesOperationsDeleteSample.js create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/cacheNodesOperationsGetSample.js create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/cacheNodesOperationsListByResourceGroupSample.js create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/cacheNodesOperationsListBySubscriptionSample.js create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/cacheNodesOperationsUpdateSample.js create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseCustomerOperationsCreateOrUpdateSample.js create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseCustomerOperationsDeleteSample.js create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseCustomerOperationsGetSample.js create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseCustomerOperationsListByResourceGroupSample.js create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseCustomerOperationsListBySubscriptionSample.js create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseCustomerOperationsUpdateSample.js create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseMccCacheNodesOperationsCreateOrUpdateSample.js create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseMccCacheNodesOperationsDeleteSample.js create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseMccCacheNodesOperationsGetCacheNodeInstallDetailsSample.js create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseMccCacheNodesOperationsGetSample.js create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseMccCacheNodesOperationsListByEnterpriseMccCustomerResourceSample.js create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseMccCacheNodesOperationsUpdateSample.js create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseMccCustomersCreateOrUpdateSample.js create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseMccCustomersDeleteSample.js create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseMccCustomersGetSample.js create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseMccCustomersListByResourceGroupSample.js create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseMccCustomersListBySubscriptionSample.js create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseMccCustomersUpdateSample.js create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCacheNodesOperationsCreateOrUpdateSample.js create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCacheNodesOperationsDeleteSample.js create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCacheNodesOperationsGetBgpCidrsSample.js create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCacheNodesOperationsGetCacheNodeInstallDetailsSample.js create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCacheNodesOperationsGetSample.js create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCacheNodesOperationsListByIspCustomerResourceSample.js create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCacheNodesOperationsUpdateSample.js create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCustomersCreateOrUpdateSample.js create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCustomersDeleteSample.js create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCustomersGetSample.js create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCustomersListByResourceGroupSample.js create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCustomersListBySubscriptionSample.js create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCustomersUpdateSample.js create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/operationsListSample.js create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/package.json create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/sample.env create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/README.md create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/package.json create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/sample.env create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/cacheNodesOperationsCreateorUpdateSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/cacheNodesOperationsDeleteSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/cacheNodesOperationsGetSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/cacheNodesOperationsListByResourceGroupSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/cacheNodesOperationsListBySubscriptionSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/cacheNodesOperationsUpdateSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseCustomerOperationsCreateOrUpdateSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseCustomerOperationsDeleteSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseCustomerOperationsGetSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseCustomerOperationsListByResourceGroupSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseCustomerOperationsListBySubscriptionSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseCustomerOperationsUpdateSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseMccCacheNodesOperationsCreateOrUpdateSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseMccCacheNodesOperationsDeleteSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseMccCacheNodesOperationsGetCacheNodeInstallDetailsSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseMccCacheNodesOperationsGetSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseMccCacheNodesOperationsListByEnterpriseMccCustomerResourceSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseMccCacheNodesOperationsUpdateSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseMccCustomersCreateOrUpdateSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseMccCustomersDeleteSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseMccCustomersGetSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseMccCustomersListByResourceGroupSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseMccCustomersListBySubscriptionSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseMccCustomersUpdateSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCacheNodesOperationsCreateOrUpdateSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCacheNodesOperationsDeleteSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCacheNodesOperationsGetBgpCidrsSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCacheNodesOperationsGetCacheNodeInstallDetailsSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCacheNodesOperationsGetSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCacheNodesOperationsListByIspCustomerResourceSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCacheNodesOperationsUpdateSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCustomersCreateOrUpdateSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCustomersDeleteSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCustomersGetSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCustomersListByResourceGroupSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCustomersListBySubscriptionSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCustomersUpdateSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/operationsListSample.ts create mode 100644 sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/tsconfig.json create mode 100644 sdk/connectedcache/arm-connectedcache/src/api/cacheNodesOperations/index.ts create mode 100644 sdk/connectedcache/arm-connectedcache/src/api/connectedCacheContext.ts create mode 100644 sdk/connectedcache/arm-connectedcache/src/api/enterpriseCustomerOperations/index.ts create mode 100644 sdk/connectedcache/arm-connectedcache/src/api/enterpriseMccCacheNodesOperations/index.ts create mode 100644 sdk/connectedcache/arm-connectedcache/src/api/enterpriseMccCustomers/index.ts create mode 100644 sdk/connectedcache/arm-connectedcache/src/api/index.ts create mode 100644 sdk/connectedcache/arm-connectedcache/src/api/ispCacheNodesOperations/index.ts create mode 100644 sdk/connectedcache/arm-connectedcache/src/api/ispCustomers/index.ts create mode 100644 sdk/connectedcache/arm-connectedcache/src/api/operations/index.ts create mode 100644 sdk/connectedcache/arm-connectedcache/src/api/options.ts create mode 100644 sdk/connectedcache/arm-connectedcache/src/classic/cacheNodesOperations/index.ts create mode 100644 sdk/connectedcache/arm-connectedcache/src/classic/enterpriseCustomerOperations/index.ts create mode 100644 sdk/connectedcache/arm-connectedcache/src/classic/enterpriseMccCacheNodesOperations/index.ts create mode 100644 sdk/connectedcache/arm-connectedcache/src/classic/enterpriseMccCustomers/index.ts create mode 100644 sdk/connectedcache/arm-connectedcache/src/classic/index.ts create mode 100644 sdk/connectedcache/arm-connectedcache/src/classic/ispCacheNodesOperations/index.ts create mode 100644 sdk/connectedcache/arm-connectedcache/src/classic/ispCustomers/index.ts create mode 100644 sdk/connectedcache/arm-connectedcache/src/classic/operations/index.ts create mode 100644 sdk/connectedcache/arm-connectedcache/src/connectedCacheClient.ts create mode 100644 sdk/connectedcache/arm-connectedcache/src/helpers/serializerHelpers.ts create mode 100644 sdk/connectedcache/arm-connectedcache/src/index.ts create mode 100644 sdk/connectedcache/arm-connectedcache/src/logger.ts create mode 100644 sdk/connectedcache/arm-connectedcache/src/models/index.ts create mode 100644 sdk/connectedcache/arm-connectedcache/src/models/models.ts create mode 100644 sdk/connectedcache/arm-connectedcache/src/restorePollerHelpers.ts create mode 100644 sdk/connectedcache/arm-connectedcache/src/static-helpers/pagingHelpers.ts create mode 100644 sdk/connectedcache/arm-connectedcache/src/static-helpers/pollingHelpers.ts create mode 100644 sdk/connectedcache/arm-connectedcache/test/public/connectedcache_operations_test.spec.ts create mode 100644 sdk/connectedcache/arm-connectedcache/test/public/utils/recordedClient.ts create mode 100644 sdk/connectedcache/arm-connectedcache/tsconfig.browser.config.json create mode 100644 sdk/connectedcache/arm-connectedcache/tsconfig.json create mode 100644 sdk/connectedcache/arm-connectedcache/tsp-location.yaml create mode 100644 sdk/connectedcache/arm-connectedcache/vitest.browser.config.ts create mode 100644 sdk/connectedcache/arm-connectedcache/vitest.config.ts create mode 100644 sdk/connectedcache/ci.mgmt.yml diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index d9c0cb9dba3..c7319c4f110 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -404,6 +404,9 @@ sdk/ai/ai-inference-rest @glharper @dargilco @jhakulin # PRLabel: %Mgmt /sdk/communication/arm-communication/ @qiaozha @MaryGao +# PRLabel: %Mgmt +/sdk/connectedcache/arm-connectedcache/ @qiaozha @MaryGao + # PRLabel: %Mgmt /sdk/compute/arm-compute/ @qiaozha @MaryGao diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 23d4fd2bc43..f93ef640a70 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -197,6 +197,9 @@ dependencies: '@rush-temp/arm-confluent': specifier: file:./projects/arm-confluent.tgz version: file:projects/arm-confluent.tgz + '@rush-temp/arm-connectedcache': + specifier: file:./projects/arm-connectedcache.tgz + version: file:projects/arm-connectedcache.tgz '@rush-temp/arm-connectedvmware': specifier: file:./projects/arm-connectedvmware.tgz version: file:projects/arm-connectedvmware.tgz @@ -13882,6 +13885,43 @@ packages: - supports-color dev: false + file:projects/arm-connectedcache.tgz: + resolution: {integrity: sha512-z09VpU8HdMfm7XwTPPUYSVW3NaaMfTQwjVUggbtWe+xm7gPo5L3zB13SjvVaduyXorZg5roXzeT2At0W6Vkkqg==, tarball: file:projects/arm-connectedcache.tgz} + name: '@rush-temp/arm-connectedcache' + version: 0.0.0 + dependencies: + '@microsoft/api-extractor': 7.47.11(@types/node@18.19.64) + '@types/node': 18.19.64 + '@vitest/browser': 2.1.5(@types/node@18.19.64)(playwright@1.48.2)(typescript@5.6.3)(vitest@2.1.5) + '@vitest/coverage-istanbul': 2.1.5(vitest@2.1.5) + dotenv: 16.4.5 + eslint: 8.57.1 + playwright: 1.48.2 + tshy: 2.0.1 + tslib: 2.8.1 + typescript: 5.6.3 + vitest: 2.1.5(@types/node@18.19.64)(@vitest/browser@2.1.5) + transitivePeerDependencies: + - '@edge-runtime/vm' + - '@vitest/ui' + - bufferutil + - happy-dom + - jsdom + - less + - lightningcss + - msw + - safaridriver + - sass + - sass-embedded + - stylus + - sugarss + - supports-color + - terser + - utf-8-validate + - vite + - webdriverio + dev: false + file:projects/arm-connectedvmware.tgz: resolution: {integrity: sha512-vhQ7ZhjOJ0BmjhBsyAvkQLyF9VgXGOcW83y+4X2y03VpkYuTF4nh/lREFr87lhx6j9IGAZHVMoLNIzwMiqpMTg==, tarball: file:projects/arm-connectedvmware.tgz} name: '@rush-temp/arm-connectedvmware' @@ -21769,7 +21809,7 @@ packages: dev: false file:projects/maps-route.tgz: - resolution: {integrity: sha512-0ctRSAumdIjIYk2gsJWzoER0exI6GI4XYhIcuVJH1xNf19LCLOw0erfKvdgYnMscP447hOavv+t1DHahw6yUsw==, tarball: file:projects/maps-route.tgz} + resolution: {integrity: sha512-7CIlx59lH1iXpkFOrf1zQ6r986jREdZS9F+cKejJPIrbqqj0e9uO5Po1q9aUwQgEkQFlh8wQ55GrK36jhQG5jQ==, tarball: file:projects/maps-route.tgz} name: '@rush-temp/maps-route' version: 0.0.0 dependencies: diff --git a/eng/ignore-links.txt b/eng/ignore-links.txt index 648e175b984..3cd2a78daf9 100644 --- a/eng/ignore-links.txt +++ b/eng/ignore-links.txt @@ -13,3 +13,4 @@ https://docs.microsoft.com/javascript/api/@azure/arm-trustedsigning?view=azure-n https://docs.microsoft.com/javascript/api/@azure/arm-containerorchestratorruntime?view=azure-node-preview https://docs.microsoft.com/javascript/api/@azure/arm-iotoperations?view=azure-node-preview https://docs.microsoft.com/javascript/api/@azure/arm-databoundaries?view=azure-node-preview +https://docs.microsoft.com/javascript/api/@azure/arm-connectedcache?view=azure-node-preview diff --git a/rush.json b/rush.json index b6f3ab160e7..59981552adf 100644 --- a/rush.json +++ b/rush.json @@ -2306,6 +2306,11 @@ "packageName": "@azure/arm-containerorchestratorruntime", "projectFolder": "sdk/kubernetesruntime/arm-containerorchestratorruntime", "versionPolicyName": "management" + }, + { + "packageName": "@azure/arm-connectedcache", + "projectFolder": "sdk/connectedcache/arm-connectedcache", + "versionPolicyName": "management" } ] } diff --git a/sdk/connectedcache/arm-connectedcache/CHANGELOG.md b/sdk/connectedcache/arm-connectedcache/CHANGELOG.md new file mode 100644 index 00000000000..c70842647d8 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/CHANGELOG.md @@ -0,0 +1,7 @@ +# Release History + +## 1.0.0-beta.1 (2024-11-19) + +### Features Added + +Initial release of the Azure ConnectedCache package diff --git a/sdk/connectedcache/arm-connectedcache/LICENSE b/sdk/connectedcache/arm-connectedcache/LICENSE new file mode 100644 index 00000000000..7d593474096 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2024 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/sdk/connectedcache/arm-connectedcache/README.md b/sdk/connectedcache/arm-connectedcache/README.md new file mode 100644 index 00000000000..90da7dfe1a6 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/README.md @@ -0,0 +1,102 @@ +# Azure ConnectedCache client library for JavaScript + +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure ConnectedCache client. + +Microsoft Connected Cache Rest Api version 2023-05-01-preview + +Key links: + +- [Package (NPM)](https://www.npmjs.com/package/@azure/arm-connectedcache) +- [API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-connectedcache?view=azure-node-preview) + +## Getting started + +### Currently supported environments + +- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule) +- Latest versions of Safari, Chrome, Edge and Firefox. + +See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details. + +### Prerequisites + +- An [Azure subscription][azure_sub]. + +### Install the `@azure/arm-connectedcache` package + +Install the Azure ConnectedCache client library for JavaScript with `npm`: + +```bash +npm install @azure/arm-connectedcache +``` + +### Create and authenticate a `ConnectedCacheClient` + +To create a client object to access the Azure ConnectedCache API, you will need the `endpoint` of your Azure ConnectedCache resource and a `credential`. The Azure ConnectedCache client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure ConnectedCache resource in the [Azure Portal][azure_portal]. + +You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). + +To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package: + +```bash +npm install @azure/identity +``` + +You will also need to **register a new AAD application and grant access to Azure ConnectedCache** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). +Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`. + +For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). + +```javascript +const { ConnectedCacheClient } = require("@azure/arm-connectedcache"); +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. + +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new ConnectedCacheClient(new DefaultAzureCredential(), subscriptionId); + +// For client-side applications running in the browser, use this code instead: +// const credential = new InteractiveBrowserCredential({ +// tenantId: "", +// clientId: "" +// }); +// const client = new ConnectedCacheClient(credential, subscriptionId); +``` + + +### JavaScript Bundle +To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). + +## Key concepts + +### ConnectedCacheClient + +`ConnectedCacheClient` is the primary interface for developers using the Azure ConnectedCache client library. Explore the methods on this client object to understand the different features of the Azure ConnectedCache service that you can access. + +## Troubleshooting + +### Logging + +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"); +setLogLevel("info"); +``` + +For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger). + + +## Contributing + +If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code. + +## Related projects + +- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) + +[azure_sub]: https://azure.microsoft.com/free/ +[azure_portal]: https://portal.azure.com +[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity +[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential diff --git a/sdk/connectedcache/arm-connectedcache/api-extractor.json b/sdk/connectedcache/arm-connectedcache/api-extractor.json new file mode 100644 index 00000000000..b29cdcc05a8 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/api-extractor.json @@ -0,0 +1,18 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + "mainEntryPointFilePath": "./dist/esm/index.d.ts", + "docModel": { "enabled": true }, + "apiReport": { "enabled": true, "reportFolder": "./review" }, + "dtsRollup": { + "enabled": true, + "untrimmedFilePath": "", + "publicTrimmedFilePath": "./types/arm-connectedcache.d.ts" + }, + "messages": { + "tsdocMessageReporting": { "default": { "logLevel": "none" } }, + "extractorMessageReporting": { + "ae-missing-release-tag": { "logLevel": "none" }, + "ae-unresolved-link": { "logLevel": "none" } + } + } +} diff --git a/sdk/connectedcache/arm-connectedcache/assets.json b/sdk/connectedcache/arm-connectedcache/assets.json new file mode 100644 index 00000000000..b77abda6fd3 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/assets.json @@ -0,0 +1,6 @@ +{ + "AssetsRepo": "Azure/azure-sdk-assets", + "AssetsRepoPrefixPath": "js", + "TagPrefix": "js/connectedcache/arm-connectedcache", + "Tag": "js/connectedcache/arm-connectedcache_c716744a2d" +} diff --git a/sdk/connectedcache/arm-connectedcache/eslint.config.mjs b/sdk/connectedcache/arm-connectedcache/eslint.config.mjs new file mode 100644 index 00000000000..03244d34a19 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/eslint.config.mjs @@ -0,0 +1,17 @@ +import azsdkEslint from "@azure/eslint-plugin-azure-sdk"; + +export default [ + ...azsdkEslint.configs.recommended, + { + rules: { + "@azure/azure-sdk/ts-modules-only-named": "warn", + "@azure/azure-sdk/ts-apiextractor-json-types": "warn", + "@azure/azure-sdk/ts-package-json-types": "warn", + "@azure/azure-sdk/ts-package-json-engine-is-present": "warn", + "@azure/azure-sdk/ts-package-json-module": "off", + "@azure/azure-sdk/ts-package-json-files-required": "off", + "@azure/azure-sdk/ts-package-json-main-is-cjs": "off", + "tsdoc/syntax": "warn", + }, + }, +]; diff --git a/sdk/connectedcache/arm-connectedcache/package.json b/sdk/connectedcache/arm-connectedcache/package.json new file mode 100644 index 00000000000..bca0f5ddcc8 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/package.json @@ -0,0 +1,160 @@ +{ + "name": "@azure/arm-connectedcache", + "version": "1.0.0-beta.1", + "description": "A generated SDK for ConnectedCacheClient.", + "engines": { + "node": ">=18.0.0" + }, + "sideEffects": false, + "autoPublish": false, + "tshy": { + "exports": { + "./package.json": "./package.json", + ".": "./src/index.ts", + "./models": "./src/models/index.ts" + }, + "dialects": [ + "esm", + "commonjs" + ], + "esmDialects": [ + "browser", + "react-native" + ], + "selfLink": false + }, + "type": "module", + "keywords": [ + "node", + "azure", + "cloud", + "typescript", + "browser", + "isomorphic" + ], + "author": "Microsoft Corporation", + "license": "MIT", + "files": [ + "dist", + "README.md", + "LICENSE", + "review/*", + "CHANGELOG.md" + ], + "sdk-type": "mgmt", + "repository": "github:Azure/azure-sdk-for-js", + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "prettier": "@azure/eslint-plugin-azure-sdk/prettier.json", + "//metadata": { + "constantPaths": [ + { + "path": "src/api/connectedCacheContext.ts", + "prefix": "userAgentInfo" + } + ] + }, + "dependencies": { + "@azure/core-util": "^1.9.2", + "@azure-rest/core-client": "^2.3.1", + "@azure/core-auth": "^1.6.0", + "@azure/core-rest-pipeline": "^1.5.0", + "@azure/logger": "^1.0.0", + "tslib": "^2.6.2", + "@azure/core-lro": "^3.1.0", + "@azure/abort-controller": "^2.1.2" + }, + "devDependencies": { + "dotenv": "^16.0.0", + "@microsoft/api-extractor": "^7.40.3", + "@types/node": "^18.0.0", + "eslint": "^8.55.0", + "typescript": "~5.6.2", + "tshy": "^2.0.0", + "@azure/identity": "^4.2.1", + "@vitest/browser": "^2.0.5", + "@vitest/coverage-istanbul": "^2.0.5", + "playwright": "^1.41.2", + "vitest": "^2.0.5", + "@azure-tools/test-credential": "^2.0.0", + "@azure-tools/test-recorder": "^4.0.0", + "@azure/dev-tool": "^1.0.0", + "@azure/eslint-plugin-azure-sdk": "^3.0.0" + }, + "scripts": { + "clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", + "extract-api": "dev-tool run vendored rimraf review && dev-tool run vendored mkdirp ./review && dev-tool run extract-api", + "pack": "npm pack 2>&1", + "lint": "echo skipped", + "lint:fix": "echo skipped", + "unit-test": "npm run unit-test:node && npm run unit-test:browser", + "unit-test:browser": "npm run build:test && dev-tool run test:vitest --browser", + "unit-test:node": "dev-tool run test:vitest", + "integration-test": "npm run integration-test:node && npm run integration-test:browser", + "integration-test:browser": "echo skipped", + "integration-test:node": "echo skipped", + "build:samples": "dev-tool run typecheck --paths samples-dev/*.ts && dev-tool samples publish -f", + "check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" \"samples-dev/*.ts\"", + "execute:samples": "dev-tool samples run samples-dev", + "format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" \"samples-dev/*.ts\"", + "generate:client": "echo skipped", + "test:browser": "npm run clean && npm run build:test && npm run unit-test:browser && npm run integration-test:browser", + "minify": "dev-tool run vendored uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", + "build:test": "npm run clean && dev-tool run build-package && dev-tool run build-test", + "build": "npm run clean && dev-tool run build-package && dev-tool run vendored mkdirp ./review && dev-tool run extract-api", + "test:node": "npm run clean && dev-tool run build-package && npm run unit-test:node && npm run integration-test:node", + "test": "npm run clean && dev-tool run build-package && npm run unit-test:node && dev-tool run bundle && npm run unit-test:browser && npm run integration-test", + "update-snippets": "echo skipped" + }, + "//sampleConfiguration": { + "productName": "@azure/arm-connectedcache", + "productSlugs": [ + "azure" + ], + "disableDocsMs": true, + "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-connectedcache?view=azure-node-preview" + }, + "exports": { + "./package.json": "./package.json", + ".": { + "browser": { + "types": "./dist/browser/index.d.ts", + "default": "./dist/browser/index.js" + }, + "react-native": { + "types": "./dist/react-native/index.d.ts", + "default": "./dist/react-native/index.js" + }, + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" + } + }, + "./models": { + "browser": { + "types": "./dist/browser/models/index.d.ts", + "default": "./dist/browser/models/index.js" + }, + "react-native": { + "types": "./dist/react-native/models/index.d.ts", + "default": "./dist/react-native/models/index.js" + }, + "import": { + "types": "./dist/esm/models/index.d.ts", + "default": "./dist/esm/models/index.js" + }, + "require": { + "types": "./dist/commonjs/models/index.d.ts", + "default": "./dist/commonjs/models/index.js" + } + } + }, + "main": "./dist/commonjs/index.js", + "types": "./dist/commonjs/index.d.ts", + "module": "./dist/esm/index.js" +} diff --git a/sdk/connectedcache/arm-connectedcache/review/arm-connectedcache-models.api.md b/sdk/connectedcache/arm-connectedcache/review/arm-connectedcache-models.api.md new file mode 100644 index 00000000000..3098b9173d5 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/review/arm-connectedcache-models.api.md @@ -0,0 +1,441 @@ +## API Report File for "@azure/arm-connectedcache" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +// @public +export type ActionType = string; + +// @public +export interface AdditionalCacheNodeProperties { + readonly aggregatedStatusCode?: number; + readonly aggregatedStatusDetails?: string; + readonly aggregatedStatusText?: string; + readonly autoUpdateAppliedVersion?: string; + readonly autoUpdateLastAppliedDateTime?: Date; + readonly autoUpdateLastAppliedDetails?: string; + readonly autoUpdateLastAppliedState?: string; + readonly autoUpdateLastTriggeredDateTime?: Date; + readonly autoUpdateNextAvailableDateTime?: Date; + readonly autoUpdateNextAvailableVersion?: string; + autoUpdateVersion?: string; + bgpConfiguration?: BgpConfiguration; + cacheNodePropertiesDetailsIssuesList?: string[]; + readonly cacheNodeState?: number; + readonly cacheNodeStateDetailedText?: string; + readonly cacheNodeStateShortText?: string; + driveConfiguration?: CacheNodeDriveConfiguration[]; + readonly isProvisioned?: boolean; + isProxyRequired?: ProxyRequired; + optionalProperty1?: string; + optionalProperty2?: string; + optionalProperty3?: string; + optionalProperty4?: string; + optionalProperty5?: string; + osType?: OsType; + readonly productVersion?: string; + proxyUrl?: string; + proxyUrlConfiguration?: ProxyUrlConfiguration; + updateCycleType?: CycleType; + updateInfoDetails?: string; + updateRequestedDateTime?: Date; +} + +// @public +export interface AdditionalCustomerProperties { + customerAsn?: string; + readonly customerAsnEstimatedEgressPeekGbps?: number; + customerEmail?: string; + customerEntitlementExpiration?: Date; + customerEntitlementSkuGuid?: string; + customerEntitlementSkuId?: string; + customerEntitlementSkuName?: string; + readonly customerOrgName?: string; + readonly customerPropertiesOverviewAverageEgressMbps?: number; + readonly customerPropertiesOverviewAverageMissMbps?: number; + readonly customerPropertiesOverviewCacheEfficiency?: number; + readonly customerPropertiesOverviewCacheNodesHealthyCount?: number; + readonly customerPropertiesOverviewCacheNodesUnhealthyCount?: number; + readonly customerPropertiesOverviewEgressMbpsMax?: number; + readonly customerPropertiesOverviewEgressMbpsMaxDateTime?: Date; + readonly customerPropertiesOverviewMissMbpsMax?: number; + readonly customerPropertiesOverviewMissMbpsMaxDateTime?: Date; + customerTransitAsn?: string; + customerTransitState?: CustomerTransitState; + optionalProperty1?: string; + optionalProperty2?: string; + optionalProperty3?: string; + optionalProperty4?: string; + optionalProperty5?: string; + readonly peeringDbLastUpdateDate?: Date; + readonly peeringDbLastUpdateTime?: Date; + readonly signupPhaseStatusCode?: number; + readonly signupPhaseStatusText?: string; + readonly signupStatus?: boolean; + readonly signupStatusCode?: number; + readonly signupStatusText?: string; +} + +// @public +export type AutoUpdateRingType = string; + +// @public +export interface BgpCidrsConfiguration { + readonly bgpCidrs?: string[]; +} + +// @public +export interface BgpConfiguration { + asnToIpAddressMapping?: string; +} + +// @public +export type BgpReviewStateEnum = string; + +// @public +export interface CacheNodeDriveConfiguration { + cacheNumber?: number; + nginxMapping?: string; + physicalPath?: string; + sizeInGb?: number; +} + +// @public +export interface CacheNodeEntity { + readonly addressSpace?: number; + autoUpdateRequestedDay?: number; + autoUpdateRequestedTime?: string; + autoUpdateRequestedWeek?: number; + autoUpdateRingType?: AutoUpdateRingType; + readonly bgpAddressSpace?: number; + readonly bgpCidrBlocksCount?: number; + readonly bgpCidrCsvLastUpdateTime?: Date; + readonly bgpFileBytesTruncated?: number; + readonly bgpLastReportedTime?: Date; + readonly bgpNumberOfRecords?: number; + readonly bgpNumberOfTimesUpdated?: number; + readonly bgpReviewFeedback?: string; + readonly bgpReviewState?: BgpReviewStateEnum; + readonly bgpReviewStateText?: string; + cacheNodeId?: string; + cacheNodeName?: string; + readonly category?: string; + cidrCsv?: string[]; + readonly cidrCsvLastUpdateTime?: Date; + cidrSelectionType?: number; + readonly clientTenantId?: string; + readonly configurationState?: ConfigurationState; + readonly configurationStateText?: string; + readonly containerConfigurations?: string; + readonly containerResyncTrigger?: number; + readonly createAsyncOperationId?: string; + customerAsn?: number; + readonly customerId?: string; + customerIndex?: string; + customerName?: string; + readonly deleteAsyncOperationId?: string; + fullyQualifiedDomainName?: string; + fullyQualifiedResourceId?: string; + readonly imageUri?: string; + ipAddress?: string; + isEnabled?: boolean; + isEnterpriseManaged?: boolean; + readonly isFrozen?: boolean; + readonly lastSyncWithAzureTimestamp?: Date; + readonly lastUpdatedTimestamp?: Date; + maxAllowableEgressInMbps?: number; + readonly maxAllowableProbability?: number; + readonly releaseVersion?: number; + readonly reviewFeedback?: string; + readonly reviewState?: number; + readonly reviewStateText?: string; + shouldMigrate?: boolean; + readonly synchWithAzureAttemptsCount?: number; + readonly workerConnections?: number; + readonly workerConnectionsLastUpdatedDateTime?: Date; + readonly xCid?: string; +} + +// @public +export interface CacheNodeInstallProperties { + cacheNodeId?: string; + customerId?: string; + readonly primaryAccountKey?: string; + readonly registrationKey?: string; + readonly secondaryAccountKey?: string; +} + +// @public +export interface CacheNodeOldResponse { + error?: ErrorDetail; + readonly provisioningState?: ProvisioningState; + readonly status?: string; + statusCode?: string; + statusDetails?: string; + statusText?: string; +} + +// @public +export interface CacheNodePreviewResource extends TrackedResource { + properties?: CacheNodeOldResponse; +} + +// @public +export interface CacheNodeProperty { + additionalCacheNodeProperties?: AdditionalCacheNodeProperties; + cacheNode?: CacheNodeEntity; + error?: ErrorDetail; + readonly provisioningState?: ProvisioningState; + readonly status?: string; + statusCode?: string; + statusDetails?: string; + statusText?: string; +} + +// @public +export type ConfigurationState = string; + +// @public +export interface ConnectedCachePatchResource { + tags?: Record; +} + +// @public +export type CreatedByType = string; + +// @public +export interface CustomerEntity { + clientTenantId?: string; + contactEmail?: string; + contactName?: string; + contactPhone?: string; + readonly createAsyncOperationId?: string; + readonly customerId?: string; + customerName?: string; + readonly deleteAsyncOperationId?: string; + fullyQualifiedResourceId?: string; + isEnterpriseManaged?: boolean; + isEntitled?: boolean; + readonly lastSyncWithAzureTimestamp?: Date; + releaseVersion?: number; + resendSignupCode?: boolean; + shouldMigrate?: boolean; + readonly synchWithAzureAttemptsCount?: number; + verifySignupCode?: boolean; + verifySignupPhrase?: string; +} + +// @public +export interface CustomerProperty { + additionalCustomerProperties?: AdditionalCustomerProperties; + customer?: CustomerEntity; + readonly error?: ErrorDetail; + readonly provisioningState?: ProvisioningState; + readonly status?: string; + readonly statusCode?: string; + readonly statusDetails?: string; + readonly statusText?: string; +} + +// @public +export type CustomerTransitState = string; + +// @public +export type CycleType = string; + +// @public +export interface EnterpriseMccCacheNodeResource extends TrackedResource { + properties?: CacheNodeProperty; +} + +// @public +export interface EnterpriseMccCustomerResource extends TrackedResource { + properties?: CustomerProperty; +} + +// @public +export interface EnterprisePreviewResource extends TrackedResource { + properties?: CacheNodeOldResponse; +} + +// @public +export interface ErrorAdditionalInfo { + readonly info?: Record; + readonly type?: string; +} + +// @public +export interface ErrorDetail { + readonly additionalInfo?: ErrorAdditionalInfo[]; + readonly code?: string; + readonly details?: ErrorDetail[]; + readonly message?: string; + readonly target?: string; +} + +// @public +export interface IspCacheNodeResource extends TrackedResource { + properties?: CacheNodeProperty; +} + +// @public +export interface IspCustomerResource extends TrackedResource { + properties?: CustomerProperty; +} + +// @public +export enum KnownActionType { + Internal = "Internal" +} + +// @public +export enum KnownAutoUpdateRingType { + Fast = "Fast", + Preview = "Preview", + Slow = "Slow" +} + +// @public +export enum KnownBgpReviewStateEnum { + Approved = "Approved", + AttentionRequired = "AttentionRequired", + InReview = "InReview", + NotConfigured = "NotConfigured" +} + +// @public +export enum KnownConfigurationState { + Configured = "Configured", + NotConfigured_Ip = "NotConfigured_Ip" +} + +// @public +export enum KnownCreatedByType { + Application = "Application", + Key = "Key", + ManagedIdentity = "ManagedIdentity", + User = "User" +} + +// @public +export enum KnownCustomerTransitState { + CombinedTransit = "CombinedTransit", + NoTransit = "NoTransit", + TransitOnly = "TransitOnly" +} + +// @public +export enum KnownCycleType { + Fast = "Fast", + Preview = "Preview", + Slow = "Slow" +} + +// @public +export enum KnownOrigin { + System = "system", + User = "user", + UserSystem = "user,system" +} + +// @public +export enum KnownOsType { + Eflow = "Eflow", + Linux = "Linux", + Windows = "Windows" +} + +// @public +export enum KnownProvisioningState { + Accepted = "Accepted", + Canceled = "Canceled", + Deleting = "Deleting", + Failed = "Failed", + Succeeded = "Succeeded", + Unknown = "Unknown", + Upgrading = "Upgrading" +} + +// @public +export enum KnownProxyRequired { + None = "None", + Required = "Required" +} + +// @public +export enum KnownVersions { + v2023_05_01_preview = "2023-05-01-preview" +} + +// @public +export interface MccCacheNodeBgpCidrDetails extends TrackedResource { + properties?: BgpCidrsConfiguration; +} + +// @public +export interface MccCacheNodeInstallDetails extends TrackedResource { + properties?: CacheNodeInstallProperties; +} + +// @public +export interface Operation { + actionType?: ActionType; + readonly display?: OperationDisplay; + readonly isDataAction?: boolean; + readonly name?: string; + readonly origin?: Origin; +} + +// @public +export interface OperationDisplay { + readonly description?: string; + readonly operation?: string; + readonly provider?: string; + readonly resource?: string; +} + +// @public +export type Origin = string; + +// @public +export type OsType = string; + +// @public +export type ProvisioningState = string; + +// @public +export type ProxyRequired = string; + +// @public +export interface ProxyUrlConfiguration { + proxyUrl?: string; +} + +// @public +export interface Resource { + readonly id?: string; + readonly name?: string; + readonly systemData?: SystemData; + readonly type?: string; +} + +// @public +export interface SystemData { + createdAt?: Date; + createdBy?: string; + createdByType?: CreatedByType; + lastModifiedAt?: Date; + lastModifiedBy?: string; + lastModifiedByType?: CreatedByType; +} + +// @public +export interface TrackedResource extends Resource { + location: string; + tags?: Record; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/connectedcache/arm-connectedcache/review/arm-connectedcache.api.md b/sdk/connectedcache/arm-connectedcache/review/arm-connectedcache.api.md new file mode 100644 index 00000000000..13c710d3ae3 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/review/arm-connectedcache.api.md @@ -0,0 +1,723 @@ +## API Report File for "@azure/arm-connectedcache" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { AbortSignalLike } from '@azure/abort-controller'; +import { ClientOptions } from '@azure-rest/core-client'; +import { OperationOptions } from '@azure-rest/core-client'; +import { OperationState } from '@azure/core-lro'; +import { PathUncheckedResponse } from '@azure-rest/core-client'; +import { Pipeline } from '@azure/core-rest-pipeline'; +import { PollerLike } from '@azure/core-lro'; +import { TokenCredential } from '@azure/core-auth'; + +// @public +export type ActionType = string; + +// @public +export interface AdditionalCacheNodeProperties { + readonly aggregatedStatusCode?: number; + readonly aggregatedStatusDetails?: string; + readonly aggregatedStatusText?: string; + readonly autoUpdateAppliedVersion?: string; + readonly autoUpdateLastAppliedDateTime?: Date; + readonly autoUpdateLastAppliedDetails?: string; + readonly autoUpdateLastAppliedState?: string; + readonly autoUpdateLastTriggeredDateTime?: Date; + readonly autoUpdateNextAvailableDateTime?: Date; + readonly autoUpdateNextAvailableVersion?: string; + autoUpdateVersion?: string; + bgpConfiguration?: BgpConfiguration; + cacheNodePropertiesDetailsIssuesList?: string[]; + readonly cacheNodeState?: number; + readonly cacheNodeStateDetailedText?: string; + readonly cacheNodeStateShortText?: string; + driveConfiguration?: CacheNodeDriveConfiguration[]; + readonly isProvisioned?: boolean; + isProxyRequired?: ProxyRequired; + optionalProperty1?: string; + optionalProperty2?: string; + optionalProperty3?: string; + optionalProperty4?: string; + optionalProperty5?: string; + osType?: OsType; + readonly productVersion?: string; + proxyUrl?: string; + proxyUrlConfiguration?: ProxyUrlConfiguration; + updateCycleType?: CycleType; + updateInfoDetails?: string; + updateRequestedDateTime?: Date; +} + +// @public +export interface AdditionalCustomerProperties { + customerAsn?: string; + readonly customerAsnEstimatedEgressPeekGbps?: number; + customerEmail?: string; + customerEntitlementExpiration?: Date; + customerEntitlementSkuGuid?: string; + customerEntitlementSkuId?: string; + customerEntitlementSkuName?: string; + readonly customerOrgName?: string; + readonly customerPropertiesOverviewAverageEgressMbps?: number; + readonly customerPropertiesOverviewAverageMissMbps?: number; + readonly customerPropertiesOverviewCacheEfficiency?: number; + readonly customerPropertiesOverviewCacheNodesHealthyCount?: number; + readonly customerPropertiesOverviewCacheNodesUnhealthyCount?: number; + readonly customerPropertiesOverviewEgressMbpsMax?: number; + readonly customerPropertiesOverviewEgressMbpsMaxDateTime?: Date; + readonly customerPropertiesOverviewMissMbpsMax?: number; + readonly customerPropertiesOverviewMissMbpsMaxDateTime?: Date; + customerTransitAsn?: string; + customerTransitState?: CustomerTransitState; + optionalProperty1?: string; + optionalProperty2?: string; + optionalProperty3?: string; + optionalProperty4?: string; + optionalProperty5?: string; + readonly peeringDbLastUpdateDate?: Date; + readonly peeringDbLastUpdateTime?: Date; + readonly signupPhaseStatusCode?: number; + readonly signupPhaseStatusText?: string; + readonly signupStatus?: boolean; + readonly signupStatusCode?: number; + readonly signupStatusText?: string; +} + +// @public +export type AutoUpdateRingType = string; + +// @public +export interface BgpCidrsConfiguration { + readonly bgpCidrs?: string[]; +} + +// @public +export interface BgpConfiguration { + asnToIpAddressMapping?: string; +} + +// @public +export type BgpReviewStateEnum = string; + +// @public +export interface CacheNodeDriveConfiguration { + cacheNumber?: number; + nginxMapping?: string; + physicalPath?: string; + sizeInGb?: number; +} + +// @public +export interface CacheNodeEntity { + readonly addressSpace?: number; + autoUpdateRequestedDay?: number; + autoUpdateRequestedTime?: string; + autoUpdateRequestedWeek?: number; + autoUpdateRingType?: AutoUpdateRingType; + readonly bgpAddressSpace?: number; + readonly bgpCidrBlocksCount?: number; + readonly bgpCidrCsvLastUpdateTime?: Date; + readonly bgpFileBytesTruncated?: number; + readonly bgpLastReportedTime?: Date; + readonly bgpNumberOfRecords?: number; + readonly bgpNumberOfTimesUpdated?: number; + readonly bgpReviewFeedback?: string; + readonly bgpReviewState?: BgpReviewStateEnum; + readonly bgpReviewStateText?: string; + cacheNodeId?: string; + cacheNodeName?: string; + readonly category?: string; + cidrCsv?: string[]; + readonly cidrCsvLastUpdateTime?: Date; + cidrSelectionType?: number; + readonly clientTenantId?: string; + readonly configurationState?: ConfigurationState; + readonly configurationStateText?: string; + readonly containerConfigurations?: string; + readonly containerResyncTrigger?: number; + readonly createAsyncOperationId?: string; + customerAsn?: number; + readonly customerId?: string; + customerIndex?: string; + customerName?: string; + readonly deleteAsyncOperationId?: string; + fullyQualifiedDomainName?: string; + fullyQualifiedResourceId?: string; + readonly imageUri?: string; + ipAddress?: string; + isEnabled?: boolean; + isEnterpriseManaged?: boolean; + readonly isFrozen?: boolean; + readonly lastSyncWithAzureTimestamp?: Date; + readonly lastUpdatedTimestamp?: Date; + maxAllowableEgressInMbps?: number; + readonly maxAllowableProbability?: number; + readonly releaseVersion?: number; + readonly reviewFeedback?: string; + readonly reviewState?: number; + readonly reviewStateText?: string; + shouldMigrate?: boolean; + readonly synchWithAzureAttemptsCount?: number; + readonly workerConnections?: number; + readonly workerConnectionsLastUpdatedDateTime?: Date; + readonly xCid?: string; +} + +// @public +export interface CacheNodeInstallProperties { + cacheNodeId?: string; + customerId?: string; + readonly primaryAccountKey?: string; + readonly registrationKey?: string; + readonly secondaryAccountKey?: string; +} + +// @public +export interface CacheNodeOldResponse { + error?: ErrorDetail; + readonly provisioningState?: ProvisioningState; + readonly status?: string; + statusCode?: string; + statusDetails?: string; + statusText?: string; +} + +// @public +export interface CacheNodePreviewResource extends TrackedResource { + properties?: CacheNodeOldResponse; +} + +// @public +export interface CacheNodeProperty { + additionalCacheNodeProperties?: AdditionalCacheNodeProperties; + cacheNode?: CacheNodeEntity; + error?: ErrorDetail; + readonly provisioningState?: ProvisioningState; + readonly status?: string; + statusCode?: string; + statusDetails?: string; + statusText?: string; +} + +// @public +export interface CacheNodesOperationsCreateorUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface CacheNodesOperationsDeleteOptionalParams extends OperationOptions { +} + +// @public +export interface CacheNodesOperationsGetOptionalParams extends OperationOptions { +} + +// @public +export interface CacheNodesOperationsListByResourceGroupOptionalParams extends OperationOptions { +} + +// @public +export interface CacheNodesOperationsListBySubscriptionOptionalParams extends OperationOptions { +} + +// @public +export interface CacheNodesOperationsOperations { + createorUpdate: (resourceGroupName: string, customerResourceName: string, resource: CacheNodePreviewResource, options?: CacheNodesOperationsCreateorUpdateOptionalParams) => PollerLike, CacheNodePreviewResource>; + delete: (resourceGroupName: string, customerResourceName: string, options?: CacheNodesOperationsDeleteOptionalParams) => Promise; + get: (resourceGroupName: string, customerResourceName: string, options?: CacheNodesOperationsGetOptionalParams) => Promise; + listByResourceGroup: (resourceGroupName: string, options?: CacheNodesOperationsListByResourceGroupOptionalParams) => PagedAsyncIterableIterator; + listBySubscription: (options?: CacheNodesOperationsListBySubscriptionOptionalParams) => PagedAsyncIterableIterator; + update: (resourceGroupName: string, customerResourceName: string, properties: ConnectedCachePatchResource, options?: CacheNodesOperationsUpdateOptionalParams) => Promise; +} + +// @public +export interface CacheNodesOperationsUpdateOptionalParams extends OperationOptions { +} + +// @public +export type ConfigurationState = string; + +// @public (undocumented) +export class ConnectedCacheClient { + constructor(credential: TokenCredential, subscriptionId: string, options?: ConnectedCacheClientOptionalParams); + readonly cacheNodesOperations: CacheNodesOperationsOperations; + readonly enterpriseCustomerOperations: EnterpriseCustomerOperationsOperations; + readonly enterpriseMccCacheNodesOperations: EnterpriseMccCacheNodesOperationsOperations; + readonly enterpriseMccCustomers: EnterpriseMccCustomersOperations; + readonly ispCacheNodesOperations: IspCacheNodesOperationsOperations; + readonly ispCustomers: IspCustomersOperations; + readonly operations: OperationsOperations; + readonly pipeline: Pipeline; +} + +// @public +export interface ConnectedCacheClientOptionalParams extends ClientOptions { + apiVersion?: string; +} + +// @public +export interface ConnectedCachePatchResource { + tags?: Record; +} + +// @public +export type ContinuablePage = TPage & { + continuationToken?: string; +}; + +// @public +export type CreatedByType = string; + +// @public +export interface CustomerEntity { + clientTenantId?: string; + contactEmail?: string; + contactName?: string; + contactPhone?: string; + readonly createAsyncOperationId?: string; + readonly customerId?: string; + customerName?: string; + readonly deleteAsyncOperationId?: string; + fullyQualifiedResourceId?: string; + isEnterpriseManaged?: boolean; + isEntitled?: boolean; + readonly lastSyncWithAzureTimestamp?: Date; + releaseVersion?: number; + resendSignupCode?: boolean; + shouldMigrate?: boolean; + readonly synchWithAzureAttemptsCount?: number; + verifySignupCode?: boolean; + verifySignupPhrase?: string; +} + +// @public +export interface CustomerProperty { + additionalCustomerProperties?: AdditionalCustomerProperties; + customer?: CustomerEntity; + readonly error?: ErrorDetail; + readonly provisioningState?: ProvisioningState; + readonly status?: string; + readonly statusCode?: string; + readonly statusDetails?: string; + readonly statusText?: string; +} + +// @public +export type CustomerTransitState = string; + +// @public +export type CycleType = string; + +// @public +export interface EnterpriseCustomerOperationsCreateOrUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface EnterpriseCustomerOperationsDeleteOptionalParams extends OperationOptions { +} + +// @public +export interface EnterpriseCustomerOperationsGetOptionalParams extends OperationOptions { +} + +// @public +export interface EnterpriseCustomerOperationsListByResourceGroupOptionalParams extends OperationOptions { +} + +// @public +export interface EnterpriseCustomerOperationsListBySubscriptionOptionalParams extends OperationOptions { +} + +// @public +export interface EnterpriseCustomerOperationsOperations { + createOrUpdate: (resourceGroupName: string, customerResourceName: string, resource: EnterprisePreviewResource, options?: EnterpriseCustomerOperationsCreateOrUpdateOptionalParams) => PollerLike, EnterprisePreviewResource>; + delete: (resourceGroupName: string, customerResourceName: string, options?: EnterpriseCustomerOperationsDeleteOptionalParams) => Promise; + get: (resourceGroupName: string, customerResourceName: string, options?: EnterpriseCustomerOperationsGetOptionalParams) => Promise; + listByResourceGroup: (resourceGroupName: string, options?: EnterpriseCustomerOperationsListByResourceGroupOptionalParams) => PagedAsyncIterableIterator; + listBySubscription: (options?: EnterpriseCustomerOperationsListBySubscriptionOptionalParams) => PagedAsyncIterableIterator; + update: (resourceGroupName: string, customerResourceName: string, properties: ConnectedCachePatchResource, options?: EnterpriseCustomerOperationsUpdateOptionalParams) => Promise; +} + +// @public +export interface EnterpriseCustomerOperationsUpdateOptionalParams extends OperationOptions { +} + +// @public +export interface EnterpriseMccCacheNodeResource extends TrackedResource { + properties?: CacheNodeProperty; +} + +// @public +export interface EnterpriseMccCacheNodesOperationsCreateOrUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface EnterpriseMccCacheNodesOperationsDeleteOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface EnterpriseMccCacheNodesOperationsGetCacheNodeInstallDetailsOptionalParams extends OperationOptions { +} + +// @public +export interface EnterpriseMccCacheNodesOperationsGetOptionalParams extends OperationOptions { +} + +// @public +export interface EnterpriseMccCacheNodesOperationsListByEnterpriseMccCustomerResourceOptionalParams extends OperationOptions { +} + +// @public +export interface EnterpriseMccCacheNodesOperationsOperations { + createOrUpdate: (resourceGroupName: string, customerResourceName: string, cacheNodeResourceName: string, resource: EnterpriseMccCacheNodeResource, options?: EnterpriseMccCacheNodesOperationsCreateOrUpdateOptionalParams) => PollerLike, EnterpriseMccCacheNodeResource>; + delete: (resourceGroupName: string, customerResourceName: string, cacheNodeResourceName: string, options?: EnterpriseMccCacheNodesOperationsDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, customerResourceName: string, cacheNodeResourceName: string, options?: EnterpriseMccCacheNodesOperationsGetOptionalParams) => Promise; + getCacheNodeInstallDetails: (resourceGroupName: string, customerResourceName: string, cacheNodeResourceName: string, options?: EnterpriseMccCacheNodesOperationsGetCacheNodeInstallDetailsOptionalParams) => Promise; + listByEnterpriseMccCustomerResource: (resourceGroupName: string, customerResourceName: string, options?: EnterpriseMccCacheNodesOperationsListByEnterpriseMccCustomerResourceOptionalParams) => PagedAsyncIterableIterator; + update: (resourceGroupName: string, customerResourceName: string, cacheNodeResourceName: string, properties: ConnectedCachePatchResource, options?: EnterpriseMccCacheNodesOperationsUpdateOptionalParams) => Promise; +} + +// @public +export interface EnterpriseMccCacheNodesOperationsUpdateOptionalParams extends OperationOptions { +} + +// @public +export interface EnterpriseMccCustomerResource extends TrackedResource { + properties?: CustomerProperty; +} + +// @public +export interface EnterpriseMccCustomersCreateOrUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface EnterpriseMccCustomersDeleteOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface EnterpriseMccCustomersGetOptionalParams extends OperationOptions { +} + +// @public +export interface EnterpriseMccCustomersListByResourceGroupOptionalParams extends OperationOptions { +} + +// @public +export interface EnterpriseMccCustomersListBySubscriptionOptionalParams extends OperationOptions { +} + +// @public +export interface EnterpriseMccCustomersOperations { + createOrUpdate: (resourceGroupName: string, customerResourceName: string, resource: EnterpriseMccCustomerResource, options?: EnterpriseMccCustomersCreateOrUpdateOptionalParams) => PollerLike, EnterpriseMccCustomerResource>; + delete: (resourceGroupName: string, customerResourceName: string, options?: EnterpriseMccCustomersDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, customerResourceName: string, options?: EnterpriseMccCustomersGetOptionalParams) => Promise; + listByResourceGroup: (resourceGroupName: string, options?: EnterpriseMccCustomersListByResourceGroupOptionalParams) => PagedAsyncIterableIterator; + listBySubscription: (options?: EnterpriseMccCustomersListBySubscriptionOptionalParams) => PagedAsyncIterableIterator; + update: (resourceGroupName: string, customerResourceName: string, properties: ConnectedCachePatchResource, options?: EnterpriseMccCustomersUpdateOptionalParams) => Promise; +} + +// @public +export interface EnterpriseMccCustomersUpdateOptionalParams extends OperationOptions { +} + +// @public +export interface EnterprisePreviewResource extends TrackedResource { + properties?: CacheNodeOldResponse; +} + +// @public +export interface ErrorAdditionalInfo { + readonly info?: Record; + readonly type?: string; +} + +// @public +export interface ErrorDetail { + readonly additionalInfo?: ErrorAdditionalInfo[]; + readonly code?: string; + readonly details?: ErrorDetail[]; + readonly message?: string; + readonly target?: string; +} + +// @public +export interface IspCacheNodeResource extends TrackedResource { + properties?: CacheNodeProperty; +} + +// @public +export interface IspCacheNodesOperationsCreateOrUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface IspCacheNodesOperationsDeleteOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface IspCacheNodesOperationsGetBgpCidrsOptionalParams extends OperationOptions { +} + +// @public +export interface IspCacheNodesOperationsGetCacheNodeInstallDetailsOptionalParams extends OperationOptions { +} + +// @public +export interface IspCacheNodesOperationsGetOptionalParams extends OperationOptions { +} + +// @public +export interface IspCacheNodesOperationsListByIspCustomerResourceOptionalParams extends OperationOptions { +} + +// @public +export interface IspCacheNodesOperationsOperations { + createOrUpdate: (resourceGroupName: string, customerResourceName: string, cacheNodeResourceName: string, resource: IspCacheNodeResource, options?: IspCacheNodesOperationsCreateOrUpdateOptionalParams) => PollerLike, IspCacheNodeResource>; + delete: (resourceGroupName: string, customerResourceName: string, cacheNodeResourceName: string, options?: IspCacheNodesOperationsDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, customerResourceName: string, cacheNodeResourceName: string, options?: IspCacheNodesOperationsGetOptionalParams) => Promise; + getBgpCidrs: (resourceGroupName: string, customerResourceName: string, cacheNodeResourceName: string, options?: IspCacheNodesOperationsGetBgpCidrsOptionalParams) => Promise; + getCacheNodeInstallDetails: (resourceGroupName: string, customerResourceName: string, cacheNodeResourceName: string, options?: IspCacheNodesOperationsGetCacheNodeInstallDetailsOptionalParams) => Promise; + listByIspCustomerResource: (resourceGroupName: string, customerResourceName: string, options?: IspCacheNodesOperationsListByIspCustomerResourceOptionalParams) => PagedAsyncIterableIterator; + update: (resourceGroupName: string, customerResourceName: string, cacheNodeResourceName: string, properties: ConnectedCachePatchResource, options?: IspCacheNodesOperationsUpdateOptionalParams) => Promise; +} + +// @public +export interface IspCacheNodesOperationsUpdateOptionalParams extends OperationOptions { +} + +// @public +export interface IspCustomerResource extends TrackedResource { + properties?: CustomerProperty; +} + +// @public +export interface IspCustomersCreateOrUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface IspCustomersDeleteOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface IspCustomersGetOptionalParams extends OperationOptions { +} + +// @public +export interface IspCustomersListByResourceGroupOptionalParams extends OperationOptions { +} + +// @public +export interface IspCustomersListBySubscriptionOptionalParams extends OperationOptions { +} + +// @public +export interface IspCustomersOperations { + createOrUpdate: (resourceGroupName: string, customerResourceName: string, resource: IspCustomerResource, options?: IspCustomersCreateOrUpdateOptionalParams) => PollerLike, IspCustomerResource>; + delete: (resourceGroupName: string, customerResourceName: string, options?: IspCustomersDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, customerResourceName: string, options?: IspCustomersGetOptionalParams) => Promise; + listByResourceGroup: (resourceGroupName: string, options?: IspCustomersListByResourceGroupOptionalParams) => PagedAsyncIterableIterator; + listBySubscription: (options?: IspCustomersListBySubscriptionOptionalParams) => PagedAsyncIterableIterator; + update: (resourceGroupName: string, customerResourceName: string, properties: ConnectedCachePatchResource, options?: IspCustomersUpdateOptionalParams) => Promise; +} + +// @public +export interface IspCustomersUpdateOptionalParams extends OperationOptions { +} + +// @public +export enum KnownActionType { + Internal = "Internal" +} + +// @public +export enum KnownAutoUpdateRingType { + Fast = "Fast", + Preview = "Preview", + Slow = "Slow" +} + +// @public +export enum KnownBgpReviewStateEnum { + Approved = "Approved", + AttentionRequired = "AttentionRequired", + InReview = "InReview", + NotConfigured = "NotConfigured" +} + +// @public +export enum KnownConfigurationState { + Configured = "Configured", + NotConfigured_Ip = "NotConfigured_Ip" +} + +// @public +export enum KnownCreatedByType { + Application = "Application", + Key = "Key", + ManagedIdentity = "ManagedIdentity", + User = "User" +} + +// @public +export enum KnownCustomerTransitState { + CombinedTransit = "CombinedTransit", + NoTransit = "NoTransit", + TransitOnly = "TransitOnly" +} + +// @public +export enum KnownCycleType { + Fast = "Fast", + Preview = "Preview", + Slow = "Slow" +} + +// @public +export enum KnownOrigin { + System = "system", + User = "user", + UserSystem = "user,system" +} + +// @public +export enum KnownOsType { + Eflow = "Eflow", + Linux = "Linux", + Windows = "Windows" +} + +// @public +export enum KnownProvisioningState { + Accepted = "Accepted", + Canceled = "Canceled", + Deleting = "Deleting", + Failed = "Failed", + Succeeded = "Succeeded", + Unknown = "Unknown", + Upgrading = "Upgrading" +} + +// @public +export enum KnownProxyRequired { + None = "None", + Required = "Required" +} + +// @public +export enum KnownVersions { + v2023_05_01_preview = "2023-05-01-preview" +} + +// @public +export interface MccCacheNodeBgpCidrDetails extends TrackedResource { + properties?: BgpCidrsConfiguration; +} + +// @public +export interface MccCacheNodeInstallDetails extends TrackedResource { + properties?: CacheNodeInstallProperties; +} + +// @public +export interface Operation { + actionType?: ActionType; + readonly display?: OperationDisplay; + readonly isDataAction?: boolean; + readonly name?: string; + readonly origin?: Origin; +} + +// @public +export interface OperationDisplay { + readonly description?: string; + readonly operation?: string; + readonly provider?: string; + readonly resource?: string; +} + +// @public +export interface OperationsListOptionalParams extends OperationOptions { +} + +// @public +export interface OperationsOperations { + list: (options?: OperationsListOptionalParams) => PagedAsyncIterableIterator; +} + +// @public +export type Origin = string; + +// @public +export type OsType = string; + +// @public +export interface PagedAsyncIterableIterator { + [Symbol.asyncIterator](): PagedAsyncIterableIterator; + byPage: (settings?: TPageSettings) => AsyncIterableIterator>; + next(): Promise>; +} + +// @public +export interface PageSettings { + continuationToken?: string; +} + +// @public +export type ProvisioningState = string; + +// @public +export type ProxyRequired = string; + +// @public +export interface ProxyUrlConfiguration { + proxyUrl?: string; +} + +// @public +export interface Resource { + readonly id?: string; + readonly name?: string; + readonly systemData?: SystemData; + readonly type?: string; +} + +// @public +export function restorePoller(client: ConnectedCacheClient, serializedState: string, sourceOperation: (...args: any[]) => PollerLike, TResult>, options?: RestorePollerOptions): PollerLike, TResult>; + +// @public (undocumented) +export interface RestorePollerOptions extends OperationOptions { + abortSignal?: AbortSignalLike; + processResponseBody?: (result: TResponse) => Promise; + updateIntervalInMs?: number; +} + +// @public +export interface SystemData { + createdAt?: Date; + createdBy?: string; + createdByType?: CreatedByType; + lastModifiedAt?: Date; + lastModifiedBy?: string; + lastModifiedByType?: CreatedByType; +} + +// @public +export interface TrackedResource extends Resource { + location: string; + tags?: Record; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/connectedcache/arm-connectedcache/sample.env b/sdk/connectedcache/arm-connectedcache/sample.env new file mode 100644 index 00000000000..508439fc7d6 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/sample.env @@ -0,0 +1 @@ +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/sdk/connectedcache/arm-connectedcache/samples-dev/cacheNodesOperationsCreateorUpdateSample.ts b/sdk/connectedcache/arm-connectedcache/samples-dev/cacheNodesOperationsCreateorUpdateSample.ts new file mode 100644 index 00000000000..0d69ddf1e6d --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples-dev/cacheNodesOperationsCreateorUpdateSample.ts @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to creates a cacheNodes with the specified create parameters + * + * @summary creates a cacheNodes with the specified create parameters + * x-ms-original-file: 2023-05-01-preview/CacheNodesOperations_CreateorUpdate_MaximumSet_Gen.json + */ +async function cacheNodesOperationsCreateorUpdate() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const result = await client.cacheNodesOperations.createorUpdate( + "rgConnectedCache", + "lwrsyhvfpcfrwrim", + { + location: "westus", + properties: { + statusCode: "movtzupooyhdqk", + statusText: "bjnsrpzaofjntleoesjwammgbi", + statusDetails: "quuziibkwtgf", + error: {}, + }, + tags: { key8256: "oreqiywrjkmate" }, + }, + ); + console.log(result); +} + +async function main() { + cacheNodesOperationsCreateorUpdate(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples-dev/cacheNodesOperationsDeleteSample.ts b/sdk/connectedcache/arm-connectedcache/samples-dev/cacheNodesOperationsDeleteSample.ts new file mode 100644 index 00000000000..d2ff8223234 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples-dev/cacheNodesOperationsDeleteSample.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to deletes an existing cache Node + * + * @summary deletes an existing cache Node + * x-ms-original-file: 2023-05-01-preview/CacheNodesOperations_Delete_MaximumSet_Gen.json + */ +async function cacheNodesOperationsDelete() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + await client.cacheNodesOperations.delete( + "rgConnectedCache", + "otvtvhmovthjwzjzbsqkbnmpcmmeianpqxmmaspvdczmrenquxigrtuarmlcmvsnaclhcbw", + ); +} + +async function main() { + cacheNodesOperationsDelete(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples-dev/cacheNodesOperationsGetSample.ts b/sdk/connectedcache/arm-connectedcache/samples-dev/cacheNodesOperationsGetSample.ts new file mode 100644 index 00000000000..4a7fadc930d --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples-dev/cacheNodesOperationsGetSample.ts @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to retrieves the properties of a cacheNodes + * + * @summary retrieves the properties of a cacheNodes + * x-ms-original-file: 2023-05-01-preview/CacheNodesOperations_Get_MaximumSet_Gen.json + */ +async function cacheNodesOperationsGet() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const result = await client.cacheNodesOperations.get( + "rgConnectedCache", + "nqoxkgorhuzbhjwcegymzqbeydzjupemekt", + ); + console.log(result); +} + +async function main() { + cacheNodesOperationsGet(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples-dev/cacheNodesOperationsListByResourceGroupSample.ts b/sdk/connectedcache/arm-connectedcache/samples-dev/cacheNodesOperationsListByResourceGroupSample.ts new file mode 100644 index 00000000000..4819ad5652c --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples-dev/cacheNodesOperationsListByResourceGroupSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to retrieves the properties of all ConnectedCache + * + * @summary retrieves the properties of all ConnectedCache + * x-ms-original-file: 2023-05-01-preview/CacheNodesOperations_ListByResourceGroup_MaximumSet_Gen.json + */ +async function cacheNodesPrivatePreviewLegacyGetOperationListByResourceGroupGeneratedByMaximumSetRule() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.cacheNodesOperations.listByResourceGroup("rgConnectedCache")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + cacheNodesPrivatePreviewLegacyGetOperationListByResourceGroupGeneratedByMaximumSetRule(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples-dev/cacheNodesOperationsListBySubscriptionSample.ts b/sdk/connectedcache/arm-connectedcache/samples-dev/cacheNodesOperationsListBySubscriptionSample.ts new file mode 100644 index 00000000000..b757e797b1b --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples-dev/cacheNodesOperationsListBySubscriptionSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to retrieves the properties of all ConnectedCaches + * + * @summary retrieves the properties of all ConnectedCaches + * x-ms-original-file: 2023-05-01-preview/CacheNodesOperations_ListBySubscription_MaximumSet_Gen.json + */ +async function cacheNodesPrivatePreviewLegacyResourceListBySubscriptionGeneratedByMaximumSetRule() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.cacheNodesOperations.listBySubscription()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + cacheNodesPrivatePreviewLegacyResourceListBySubscriptionGeneratedByMaximumSetRule(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples-dev/cacheNodesOperationsUpdateSample.ts b/sdk/connectedcache/arm-connectedcache/samples-dev/cacheNodesOperationsUpdateSample.ts new file mode 100644 index 00000000000..00693315ba6 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples-dev/cacheNodesOperationsUpdateSample.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to updates an existing Cache Node + * + * @summary updates an existing Cache Node + * x-ms-original-file: 2023-05-01-preview/CacheNodesOperations_Update_MaximumSet_Gen.json + */ +async function cacheNodesPrivatePreviewLegacyUpdateOperationGeneratedByMaximumSetRule() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const result = await client.cacheNodesOperations.update("rgConnectedCache", "wlrwpdbcv", { + tags: { key5032: "esiuyjbpcwkpqriqiqztxuocv" }, + }); + console.log(result); +} + +async function main() { + cacheNodesPrivatePreviewLegacyUpdateOperationGeneratedByMaximumSetRule(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseCustomerOperationsCreateOrUpdateSample.ts b/sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseCustomerOperationsCreateOrUpdateSample.ts new file mode 100644 index 00000000000..510742afa1d --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseCustomerOperationsCreateOrUpdateSample.ts @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to creates a cacheNodes with the specified create parameters + * + * @summary creates a cacheNodes with the specified create parameters + * x-ms-original-file: 2023-05-01-preview/EnterpriseCustomerOperations_CreateOrUpdate_MaximumSet_Gen.json + */ +async function enterpriseCustomerOperationsCreateOrUpdate() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const result = await client.enterpriseCustomerOperations.createOrUpdate("rgConnectedCache", "l", { + properties: { + statusCode: "oldkroffqtkryqffpsi", + statusText: "bs", + statusDetails: "lhwvcz", + error: {}, + }, + tags: { key4215: "zjbszvlzf" }, + location: "zdzhhkjyogrqxwihkifnmeyhwpujbr", + }); + console.log(result); +} + +async function main() { + enterpriseCustomerOperationsCreateOrUpdate(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseCustomerOperationsDeleteSample.ts b/sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseCustomerOperationsDeleteSample.ts new file mode 100644 index 00000000000..038a8a9d100 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseCustomerOperationsDeleteSample.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to deletes an existing customer Enterprise resource + * + * @summary deletes an existing customer Enterprise resource + * x-ms-original-file: 2023-05-01-preview/EnterpriseCustomerOperations_Delete_MaximumSet_Gen.json + */ +async function enterpriseCustomerOperationsDelete() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + await client.enterpriseCustomerOperations.delete( + "rgConnectedCache", + "jeubxmhiaihcusgnahblvvckbdcetacvqgwbohlrqucodtlwuyefpejskvamgrdnwgucziodcfpjhqy", + ); +} + +async function main() { + enterpriseCustomerOperationsDelete(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseCustomerOperationsGetSample.ts b/sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseCustomerOperationsGetSample.ts new file mode 100644 index 00000000000..397d50b0cbe --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseCustomerOperationsGetSample.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to retrieves the properties of a Enterprise customer + * + * @summary retrieves the properties of a Enterprise customer + * x-ms-original-file: 2023-05-01-preview/EnterpriseCustomerOperations_Get_MaximumSet_Gen.json + */ +async function enterpriseCustomerOperationsGet() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const result = await client.enterpriseCustomerOperations.get("rgConnectedCache", "MCCTPTest2"); + console.log(result); +} + +async function main() { + enterpriseCustomerOperationsGet(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseCustomerOperationsListByResourceGroupSample.ts b/sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseCustomerOperationsListByResourceGroupSample.ts new file mode 100644 index 00000000000..8752130d420 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseCustomerOperationsListByResourceGroupSample.ts @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to retrieves the properties of all ConnectedCache enterpriseCustomers + * + * @summary retrieves the properties of all ConnectedCache enterpriseCustomers + * x-ms-original-file: 2023-05-01-preview/EnterpriseCustomerOperations_ListByResourceGroup_MaximumSet_Gen.json + */ +async function enterpriseCustomerOperationsListByResourceGroup() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.enterpriseCustomerOperations.listByResourceGroup( + "rgConnectedCache", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + enterpriseCustomerOperationsListByResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseCustomerOperationsListBySubscriptionSample.ts b/sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseCustomerOperationsListBySubscriptionSample.ts new file mode 100644 index 00000000000..a0372d2f38b --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseCustomerOperationsListBySubscriptionSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to retrieves the properties of all ConnectedCaches + * + * @summary retrieves the properties of all ConnectedCaches + * x-ms-original-file: 2023-05-01-preview/EnterpriseCustomerOperations_ListBySubscription_MaximumSet_Gen.json + */ +async function enterpriseCustomerOperationsListBySubscription() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.enterpriseCustomerOperations.listBySubscription()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + enterpriseCustomerOperationsListBySubscription(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseCustomerOperationsUpdateSample.ts b/sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseCustomerOperationsUpdateSample.ts new file mode 100644 index 00000000000..25168f64f83 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseCustomerOperationsUpdateSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to updates an existing enterpriseCustomers + * + * @summary updates an existing enterpriseCustomers + * x-ms-original-file: 2023-05-01-preview/EnterpriseCustomerOperations_Update_MaximumSet_Gen.json + */ +async function enterpriseCustomerOperationsUpdate() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const result = await client.enterpriseCustomerOperations.update( + "rgConnectedCache", + "MCCTPTest2", + { tags: { key1653: "nzjczrhclhkndesgy" } }, + ); + console.log(result); +} + +async function main() { + enterpriseCustomerOperationsUpdate(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseMccCacheNodesOperationsCreateOrUpdateSample.ts b/sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseMccCacheNodesOperationsCreateOrUpdateSample.ts new file mode 100644 index 00000000000..48fbbf68aec --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseMccCacheNodesOperationsCreateOrUpdateSample.ts @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to this api creates an ispCacheNode with the specified create parameters + * + * @summary this api creates an ispCacheNode with the specified create parameters + * x-ms-original-file: 2023-05-01-preview/EnterpriseMccCacheNodesOperations_CreateOrUpdate_MaximumSet_Gen.json + */ +async function createsAnEnterpriseMccCacheNodeResourceGeneratedByMaximumSetRule() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const result = await client.enterpriseMccCacheNodesOperations.createOrUpdate( + "rgConnectedCache", + "nhdkvstdrrtsxxuz", + "fgduqdovidpemlnmhelomffuafdrbgaasqznvrdkbvspfzsnrhncdtqquhijhdpwyzwleukqldpceyxqhqlftqrr", + { + location: "westus", + properties: { + cacheNode: { + fullyQualifiedResourceId: "yeinlleavzbehelhsucb", + customerName: "zsklcocjfjhkcpmzyefzkwamdzc", + ipAddress: "gbfkdhloyphnpnhemwrcrxlk", + customerIndex: "vafvezmelfgmjsrccjukrhppljvipg", + cacheNodeId: "fmrjefyddfn", + cacheNodeName: "qppvqxliajjfoalzjbgmxggr", + customerAsn: 25, + isEnabled: true, + maxAllowableEgressInMbps: 27, + isEnterpriseManaged: true, + cidrCsv: ["nlqlvrthafvvljuupcbcw"], + shouldMigrate: true, + cidrSelectionType: 11, + }, + statusCode: "1", + statusText: "Success", + statusDetails: "lgljxmyyoakw", + additionalCacheNodeProperties: { + cacheNodePropertiesDetailsIssuesList: ["ennbzfpuszgalzpawmwicaofqcwcj"], + driveConfiguration: [ + { + physicalPath: "pcbkezoofhamkycot", + sizeInGb: 14, + cacheNumber: 11, + nginxMapping: "cirlpkpuxg", + }, + ], + bgpConfiguration: { asnToIpAddressMapping: "fjbggfvumrn" }, + proxyUrlConfiguration: { proxyUrl: "hplstyg" }, + proxyUrl: "ihkzxlzvpcywtzrogupqozkdud", + optionalProperty1: "ph", + optionalProperty2: "soqqgpgcbhb", + optionalProperty3: "fpnycrbagptsujiotnjfuhlm", + optionalProperty4: "gesqugrxvhxlxxyvatgrautxwlmxsf", + optionalProperty5: "zknjgzpaqtvdqjydd", + }, + error: {}, + }, + tags: { key259: "qbkixjuyjkoj" }, + }, + ); + console.log(result); +} + +async function main() { + createsAnEnterpriseMccCacheNodeResourceGeneratedByMaximumSetRule(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseMccCacheNodesOperationsDeleteSample.ts b/sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseMccCacheNodesOperationsDeleteSample.ts new file mode 100644 index 00000000000..6194639f739 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseMccCacheNodesOperationsDeleteSample.ts @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to this api deletes an existing ispCacheNode resource + * + * @summary this api deletes an existing ispCacheNode resource + * x-ms-original-file: 2023-05-01-preview/EnterpriseMccCacheNodesOperations_Delete_MaximumSet_Gen.json + */ +async function enterpriseMccCacheNodesOperationsDeleteOperationGeneratedByMaximumSetRule() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + await client.enterpriseMccCacheNodesOperations.delete( + "rgConnectedCache", + "hsincngmssuzeyispnufqwinpopadvhsbsemisguxgovwdjwviqexocelijvuyr", + "vwtrhdoxvkrunpliwcao", + ); +} + +async function main() { + enterpriseMccCacheNodesOperationsDeleteOperationGeneratedByMaximumSetRule(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseMccCacheNodesOperationsGetCacheNodeInstallDetailsSample.ts b/sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseMccCacheNodesOperationsGetCacheNodeInstallDetailsSample.ts new file mode 100644 index 00000000000..9b86b69aed7 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseMccCacheNodesOperationsGetCacheNodeInstallDetailsSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to this api gets secrets of the ispCacheNode resource install details + * + * @summary this api gets secrets of the ispCacheNode resource install details + * x-ms-original-file: 2023-05-01-preview/EnterpriseMccCacheNodesOperations_GetCacheNodeInstallDetails_MaximumSet_Gen.json + */ +async function getsRequiredPropertiesForEnterpriseMccCacheNodeResourceInstallKeyDetailsGeneratedByMaximumSetRule() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const result = await client.enterpriseMccCacheNodesOperations.getCacheNodeInstallDetails( + "rgConnectedCache", + "fzwxcjmdpxxzayecabqqlh", + "ccexmqqttritxvtctivraso", + ); + console.log(result); +} + +async function main() { + getsRequiredPropertiesForEnterpriseMccCacheNodeResourceInstallKeyDetailsGeneratedByMaximumSetRule(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseMccCacheNodesOperationsGetSample.ts b/sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseMccCacheNodesOperationsGetSample.ts new file mode 100644 index 00000000000..d509e82a96c --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseMccCacheNodesOperationsGetSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to this api gets ispCacheNode resource information + * + * @summary this api gets ispCacheNode resource information + * x-ms-original-file: 2023-05-01-preview/EnterpriseMccCacheNodesOperations_Get_MaximumSet_Gen.json + */ +async function getsEnterpriseMccCacheNodeResourceInformationOfAnEnterpriseMccCustomerParentResourceGeneratedByMaximumSetRule() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const result = await client.enterpriseMccCacheNodesOperations.get( + "rgConnectedCache", + "cygqjgtcetihsajgyqwwrbclssqsvhgltrboemcqqtpoxdbhykqxblaihmrumyhbsx", + "fqxfadsultwjfzdwlqkvneakfsbyhratytmssmiukpbnus", + ); + console.log(result); +} + +async function main() { + getsEnterpriseMccCacheNodeResourceInformationOfAnEnterpriseMccCustomerParentResourceGeneratedByMaximumSetRule(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseMccCacheNodesOperationsListByEnterpriseMccCustomerResourceSample.ts b/sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseMccCacheNodesOperationsListByEnterpriseMccCustomerResourceSample.ts new file mode 100644 index 00000000000..8b1f20e3814 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseMccCacheNodesOperationsListByEnterpriseMccCustomerResourceSample.ts @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to this api retrieves information about all ispCacheNode resources under the given subscription and resource group + * + * @summary this api retrieves information about all ispCacheNode resources under the given subscription and resource group + * x-ms-original-file: 2023-05-01-preview/EnterpriseMccCacheNodesOperations_ListByEnterpriseMccCustomerResource_MaximumSet_Gen.json + */ +async function enterpriseMccCacheNodesOperationsListByEnterpriseMccCustomerResource() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.enterpriseMccCacheNodesOperations.listByEnterpriseMccCustomerResource( + "rgConnectedCache", + "syjjjzk", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + enterpriseMccCacheNodesOperationsListByEnterpriseMccCustomerResource(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseMccCacheNodesOperationsUpdateSample.ts b/sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseMccCacheNodesOperationsUpdateSample.ts new file mode 100644 index 00000000000..5b6f134134b --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseMccCacheNodesOperationsUpdateSample.ts @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to this api updates an existing ispCacheNode resource + * + * @summary this api updates an existing ispCacheNode resource + * x-ms-original-file: 2023-05-01-preview/EnterpriseMccCacheNodesOperations_Update_MaximumSet_Gen.json + */ +async function enterpriseMccCacheNodesOperationsUpdateGeneratedByMaximumSetRule() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const result = await client.enterpriseMccCacheNodesOperations.update( + "rgConnectedCache", + "qanjqtvrxzjkljdysdjvdiqcxkttskpdzykzuefhbhz", + "kllmlvazrcxmfjfozulzqnsgvspgwmhogcafvauchunlgfr", + { tags: { key1653: "nzjczrhclhkndesgy" } }, + ); + console.log(result); +} + +async function main() { + enterpriseMccCacheNodesOperationsUpdateGeneratedByMaximumSetRule(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseMccCustomersCreateOrUpdateSample.ts b/sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseMccCustomersCreateOrUpdateSample.ts new file mode 100644 index 00000000000..1ff4fdeb44b --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseMccCustomersCreateOrUpdateSample.ts @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to this api creates an enterprise mcc customer with the specified create parameters + * + * @summary this api creates an enterprise mcc customer with the specified create parameters + * x-ms-original-file: 2023-05-01-preview/EnterpriseMccCustomers_CreateOrUpdate_MaximumSet_Gen.json + */ +async function enterpriseMccCustomersCreateOrUpdate() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const result = await client.enterpriseMccCustomers.createOrUpdate( + "rgConnectedCache", + "MccRPTest1", + { + properties: { + customer: { + fullyQualifiedResourceId: "uqsbtgae", + customerName: "mkpzynfqihnjfdbaqbqwyhd", + contactEmail: "xquos", + contactPhone: "vue", + contactName: "wxyqjoyoscmvimgwhpitxky", + isEntitled: true, + releaseVersion: 20, + clientTenantId: "fproidkpgvpdnac", + isEnterpriseManaged: true, + shouldMigrate: true, + resendSignupCode: true, + verifySignupCode: true, + verifySignupPhrase: "tprjvttkgmrqlsyicnidhm", + }, + additionalCustomerProperties: { + customerEmail: "zdjgibsidydyzm", + customerTransitAsn: "habgklnxqzmozqpazoyejwiphezpi", + customerAsn: "hgrelgnrtdkleisnepfolu", + customerEntitlementSkuId: "b", + customerEntitlementSkuGuid: "rvzmdpxyflgqetvpwupnfaxsweiiz", + customerEntitlementSkuName: "waaqfijr", + customerEntitlementExpiration: new Date("2024-01-30T00:54:04.773Z"), + optionalProperty1: "qhmwxza", + optionalProperty2: "l", + optionalProperty3: "mblwwvbie", + optionalProperty4: "vzuek", + optionalProperty5: "fzjodscdfcdr", + }, + error: {}, + }, + tags: { key3379: "dpyqeaqhcnutzezom" }, + location: "westus", + }, + ); + console.log(result); +} + +async function main() { + enterpriseMccCustomersCreateOrUpdate(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseMccCustomersDeleteSample.ts b/sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseMccCustomersDeleteSample.ts new file mode 100644 index 00000000000..727b6f7f340 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseMccCustomersDeleteSample.ts @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to this api deletes an existing enterprise mcc customer resource + * + * @summary this api deletes an existing enterprise mcc customer resource + * x-ms-original-file: 2023-05-01-preview/EnterpriseMccCustomers_Delete_MaximumSet_Gen.json + */ +async function enterpriseMccCustomersDelete() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + await client.enterpriseMccCustomers.delete("rgConnectedCache", "zktb"); +} + +async function main() { + enterpriseMccCustomersDelete(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseMccCustomersGetSample.ts b/sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseMccCustomersGetSample.ts new file mode 100644 index 00000000000..007b07ef071 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseMccCustomersGetSample.ts @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets the enterprise mcc customer resource information using this get call + * + * @summary gets the enterprise mcc customer resource information using this get call + * x-ms-original-file: 2023-05-01-preview/EnterpriseMccCustomers_Get_MaximumSet_Gen.json + */ +async function enterpriseMccCustomersGet() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const result = await client.enterpriseMccCustomers.get( + "rgConnectedCache", + "pvilvqkofbjbykupeewgvzlmjao", + ); + console.log(result); +} + +async function main() { + enterpriseMccCustomersGet(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseMccCustomersListByResourceGroupSample.ts b/sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseMccCustomersListByResourceGroupSample.ts new file mode 100644 index 00000000000..4a6aad77393 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseMccCustomersListByResourceGroupSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to this api gets the information about all enterprise mcc customer resources under the given subscription and resource group + * + * @summary this api gets the information about all enterprise mcc customer resources under the given subscription and resource group + * x-ms-original-file: 2023-05-01-preview/EnterpriseMccCustomers_ListByResourceGroup_MaximumSet_Gen.json + */ +async function enterpriseMccCustomersListByResourceGroup() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.enterpriseMccCustomers.listByResourceGroup("rgConnectedCache")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + enterpriseMccCustomersListByResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseMccCustomersListBySubscriptionSample.ts b/sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseMccCustomersListBySubscriptionSample.ts new file mode 100644 index 00000000000..4ea2b46dd19 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseMccCustomersListBySubscriptionSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to this api gets information about all enterpriseMccCustomer resources under the given subscription + * + * @summary this api gets information about all enterpriseMccCustomer resources under the given subscription + * x-ms-original-file: 2023-05-01-preview/EnterpriseMccCustomers_ListBySubscription_MaximumSet_Gen.json + */ +async function enterpriseMccCustomersListBySubscription() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.enterpriseMccCustomers.listBySubscription()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + enterpriseMccCustomersListBySubscription(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseMccCustomersUpdateSample.ts b/sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseMccCustomersUpdateSample.ts new file mode 100644 index 00000000000..182893050b0 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples-dev/enterpriseMccCustomersUpdateSample.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to this api updates an existing enterprise mcc customer resource + * + * @summary this api updates an existing enterprise mcc customer resource + * x-ms-original-file: 2023-05-01-preview/EnterpriseMccCustomers_Update_MaximumSet_Gen.json + */ +async function enterpriseMccCustomersUpdate() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const result = await client.enterpriseMccCustomers.update("rgConnectedCache", "MccRPTest1", { + tags: { key1878: "warz" }, + }); + console.log(result); +} + +async function main() { + enterpriseMccCustomersUpdate(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples-dev/ispCacheNodesOperationsCreateOrUpdateSample.ts b/sdk/connectedcache/arm-connectedcache/samples-dev/ispCacheNodesOperationsCreateOrUpdateSample.ts new file mode 100644 index 00000000000..284bd0f4f6a --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples-dev/ispCacheNodesOperationsCreateOrUpdateSample.ts @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to this api creates an ispCacheNode with the specified create parameters + * + * @summary this api creates an ispCacheNode with the specified create parameters + * x-ms-original-file: 2023-05-01-preview/IspCacheNodesOperations_CreateOrUpdate_MaximumSet_Gen.json + */ +async function ispCacheNodesOperationsCreateOrUpdate() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const result = await client.ispCacheNodesOperations.createOrUpdate( + "rgConnectedCache", + "zpqzbmanlljgmkrthtydrtneavhlnlqkdmviq", + "cabakm", + { + location: "westus", + properties: { + cacheNode: { + fullyQualifiedResourceId: "hskxkpbiqbrbjiwdzrxndru", + customerName: "xwyqk", + ipAddress: "voctagljcwqgcpnionqdcbjk", + customerIndex: "qtoiglqaswivmkjhzogburcxtszmek", + cacheNodeId: "xjzffjftwcgsehanoxsl", + cacheNodeName: "mfjxb", + customerAsn: 4, + isEnabled: true, + maxAllowableEgressInMbps: 29, + isEnterpriseManaged: true, + cidrCsv: ["nlqlvrthafvvljuupcbcw"], + shouldMigrate: true, + cidrSelectionType: 4, + }, + additionalCacheNodeProperties: { + driveConfiguration: [ + { + physicalPath: "/mcc", + sizeInGb: 500, + cacheNumber: 1, + nginxMapping: "lijygenjq", + }, + ], + bgpConfiguration: { asnToIpAddressMapping: "pafcimhoog" }, + cacheNodePropertiesDetailsIssuesList: ["ex"], + proxyUrlConfiguration: { proxyUrl: "hplstyg" }, + proxyUrl: "qhux", + optionalProperty1: "hvpmt", + optionalProperty2: "talanelmsgxvksrzoeeontqkjzbpv", + optionalProperty3: "bxkoxq", + optionalProperty4: "pqlkcekupusoc", + optionalProperty5: "nyvvmrjigqdufzjdvazdca", + }, + statusCode: "1", + statusText: "Success", + statusDetails: "djruqvptzxak", + error: {}, + }, + tags: { key4171: "qtjlszkawsdujzpgohsbw" }, + }, + ); + console.log(result); +} + +async function main() { + ispCacheNodesOperationsCreateOrUpdate(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples-dev/ispCacheNodesOperationsDeleteSample.ts b/sdk/connectedcache/arm-connectedcache/samples-dev/ispCacheNodesOperationsDeleteSample.ts new file mode 100644 index 00000000000..9d5f41ab077 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples-dev/ispCacheNodesOperationsDeleteSample.ts @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to this api deletes an existing ispCacheNode resource + * + * @summary this api deletes an existing ispCacheNode resource + * x-ms-original-file: 2023-05-01-preview/IspCacheNodesOperations_Delete_MaximumSet_Gen.json + */ +async function ispCacheNodesDeleteOperationGeneratedByMaximumSetRule() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + await client.ispCacheNodesOperations.delete( + "rgConnectedCache", + "lvpcosvbfxtpzscakewx", + "wsiruvexelltpbouqxvsogqpxdizcwqwfowybncvjunlakjwcpgmqbdbgzjrsmxlkczxnsxfonhnqqa", + ); +} + +async function main() { + ispCacheNodesDeleteOperationGeneratedByMaximumSetRule(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples-dev/ispCacheNodesOperationsGetBgpCidrsSample.ts b/sdk/connectedcache/arm-connectedcache/samples-dev/ispCacheNodesOperationsGetBgpCidrsSample.ts new file mode 100644 index 00000000000..abcb0e45e09 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples-dev/ispCacheNodesOperationsGetBgpCidrsSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to this api gets ispCacheNode resource information + * + * @summary this api gets ispCacheNode resource information + * x-ms-original-file: 2023-05-01-preview/IspCacheNodesOperations_GetBgpCidrs_MaximumSet_Gen.json + */ +async function ispCacheNodesResourceBgpCidrsDetailsGeneratedByMaximumSetRule() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const result = await client.ispCacheNodesOperations.getBgpCidrs( + "rgConnectedCache", + "MccRPTest1", + "MCCCachenode1", + ); + console.log(result); +} + +async function main() { + ispCacheNodesResourceBgpCidrsDetailsGeneratedByMaximumSetRule(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples-dev/ispCacheNodesOperationsGetCacheNodeInstallDetailsSample.ts b/sdk/connectedcache/arm-connectedcache/samples-dev/ispCacheNodesOperationsGetCacheNodeInstallDetailsSample.ts new file mode 100644 index 00000000000..5c4758c14ea --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples-dev/ispCacheNodesOperationsGetCacheNodeInstallDetailsSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to this api gets secrets of the ispCacheNode resource install details + * + * @summary this api gets secrets of the ispCacheNode resource install details + * x-ms-original-file: 2023-05-01-preview/IspCacheNodesOperations_GetCacheNodeInstallDetails_MaximumSet_Gen.json + */ +async function ispCacheNodeResourceGetInstallDetailsGeneratedByMaximumSetRule() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const result = await client.ispCacheNodesOperations.getCacheNodeInstallDetails( + "rgConnectedCache", + "MccRPTest1", + "MCCCachenode1", + ); + console.log(result); +} + +async function main() { + ispCacheNodeResourceGetInstallDetailsGeneratedByMaximumSetRule(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples-dev/ispCacheNodesOperationsGetSample.ts b/sdk/connectedcache/arm-connectedcache/samples-dev/ispCacheNodesOperationsGetSample.ts new file mode 100644 index 00000000000..648edef4c39 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples-dev/ispCacheNodesOperationsGetSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to this api gets ispCacheNode resource information + * + * @summary this api gets ispCacheNode resource information + * x-ms-original-file: 2023-05-01-preview/IspCacheNodesOperations_Get_MaximumSet_Gen.json + */ +async function ispCacheNodesGetResourceGeneratedByMaximumSetRule() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const result = await client.ispCacheNodesOperations.get( + "rgConnectedCache", + "sgtqjsitdrskmgyrrkntszwrrjjkretscpjgaezraucvcwececlelcsorfunrnvxyxcsrg", + "lbsziwmudcjnwnwy", + ); + console.log(result); +} + +async function main() { + ispCacheNodesGetResourceGeneratedByMaximumSetRule(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples-dev/ispCacheNodesOperationsListByIspCustomerResourceSample.ts b/sdk/connectedcache/arm-connectedcache/samples-dev/ispCacheNodesOperationsListByIspCustomerResourceSample.ts new file mode 100644 index 00000000000..50ad1580e0b --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples-dev/ispCacheNodesOperationsListByIspCustomerResourceSample.ts @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to this api retrieves information about all ispCacheNode resources under the given subscription and resource group + * + * @summary this api retrieves information about all ispCacheNode resources under the given subscription and resource group + * x-ms-original-file: 2023-05-01-preview/IspCacheNodesOperations_ListByIspCustomerResource_MaximumSet_Gen.json + */ +async function ispCacheNodesOperationsListByIspCustomerResource() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.ispCacheNodesOperations.listByIspCustomerResource( + "rgConnectedCache", + "MccRPTest1", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + ispCacheNodesOperationsListByIspCustomerResource(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples-dev/ispCacheNodesOperationsUpdateSample.ts b/sdk/connectedcache/arm-connectedcache/samples-dev/ispCacheNodesOperationsUpdateSample.ts new file mode 100644 index 00000000000..523386d6fcd --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples-dev/ispCacheNodesOperationsUpdateSample.ts @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to this api updates an existing ispCacheNode resource + * + * @summary this api updates an existing ispCacheNode resource + * x-ms-original-file: 2023-05-01-preview/IspCacheNodesOperations_Update_MaximumSet_Gen.json + */ +async function ispCacheNodesOperationsUpdate() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const result = await client.ispCacheNodesOperations.update( + "rgConnectedCache", + "MccRPTest1", + "MCCCachenode1", + { tags: { key1653: "nzjczrhclhkndesgy" } }, + ); + console.log(result); +} + +async function main() { + ispCacheNodesOperationsUpdate(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples-dev/ispCustomersCreateOrUpdateSample.ts b/sdk/connectedcache/arm-connectedcache/samples-dev/ispCustomersCreateOrUpdateSample.ts new file mode 100644 index 00000000000..1432c3d8db9 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples-dev/ispCustomersCreateOrUpdateSample.ts @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to this api creates an ispCustomer with the specified create parameters + * + * @summary this api creates an ispCustomer with the specified create parameters + * x-ms-original-file: 2023-05-01-preview/IspCustomers_CreateOrUpdate_MaximumSet_Gen.json + */ +async function ispCustomerCreateOrUpdateGeneratedByMaximumSetRule() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const result = await client.ispCustomers.createOrUpdate("rgConnectedCache", "MccRPTest2", { + location: "westus", + properties: { + customer: { + fullyQualifiedResourceId: "uqsbtgae", + customerName: "mkpzynfqihnjfdbaqbqwyhd", + contactEmail: "xquos", + contactPhone: "vue", + contactName: "wxyqjoyoscmvimgwhpitxky", + isEntitled: true, + releaseVersion: 20, + clientTenantId: "fproidkpgvpdnac", + isEnterpriseManaged: true, + shouldMigrate: true, + resendSignupCode: true, + verifySignupCode: true, + verifySignupPhrase: "tprjvttkgmrqlsyicnidhm", + }, + additionalCustomerProperties: { + customerEmail: "zdjgibsidydyzm", + customerTransitAsn: "habgklnxqzmozqpazoyejwiphezpi", + customerAsn: "hgrelgnrtdkleisnepfolu", + customerEntitlementSkuId: "b", + customerEntitlementSkuGuid: "rvzmdpxyflgqetvpwupnfaxsweiiz", + customerEntitlementSkuName: "waaqfijr", + customerEntitlementExpiration: new Date("2024-01-30T00:54:04.773Z"), + optionalProperty1: "qhmwxza", + optionalProperty2: "l", + optionalProperty3: "mblwwvbie", + optionalProperty4: "vzuek", + optionalProperty5: "fzjodscdfcdr", + }, + error: {}, + }, + tags: { key1878: "warz" }, + }); + console.log(result); +} + +async function main() { + ispCustomerCreateOrUpdateGeneratedByMaximumSetRule(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples-dev/ispCustomersDeleteSample.ts b/sdk/connectedcache/arm-connectedcache/samples-dev/ispCustomersDeleteSample.ts new file mode 100644 index 00000000000..a9d3fe43689 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples-dev/ispCustomersDeleteSample.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to this api deletes an existing ispCustomer resource + * + * @summary this api deletes an existing ispCustomer resource + * x-ms-original-file: 2023-05-01-preview/IspCustomers_Delete_MaximumSet_Gen.json + */ +async function ispCustomersDeleteGeneratedByMaximumSetRule() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + await client.ispCustomers.delete( + "rgConnectedCache", + "hdontfoythjsaeyjhrakckgimgchxwzttbcnvntpvdsgeumxpgnjurptd", + ); +} + +async function main() { + ispCustomersDeleteGeneratedByMaximumSetRule(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples-dev/ispCustomersGetSample.ts b/sdk/connectedcache/arm-connectedcache/samples-dev/ispCustomersGetSample.ts new file mode 100644 index 00000000000..11758a93781 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples-dev/ispCustomersGetSample.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets the ispCustomer resource information using this get call + * + * @summary gets the ispCustomer resource information using this get call + * x-ms-original-file: 2023-05-01-preview/IspCustomers_Get_MaximumSet_Gen.json + */ +async function ispCustomersGetGeneratedByMaximumSetRule() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const result = await client.ispCustomers.get("rgConnectedCache", "cmcjfueweicolcjkwmsuvcj"); + console.log(result); +} + +async function main() { + ispCustomersGetGeneratedByMaximumSetRule(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples-dev/ispCustomersListByResourceGroupSample.ts b/sdk/connectedcache/arm-connectedcache/samples-dev/ispCustomersListByResourceGroupSample.ts new file mode 100644 index 00000000000..791edfcdc96 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples-dev/ispCustomersListByResourceGroupSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to this api gets the information about all ispCustomer resources under the given subscription and resource group + * + * @summary this api gets the information about all ispCustomer resources under the given subscription and resource group + * x-ms-original-file: 2023-05-01-preview/IspCustomers_ListByResourceGroup_MaximumSet_Gen.json + */ +async function ispCustomersResourceListByResourceGroupGeneratedByMaximumSetRule() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.ispCustomers.listByResourceGroup("rgConnectedCache")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + ispCustomersResourceListByResourceGroupGeneratedByMaximumSetRule(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples-dev/ispCustomersListBySubscriptionSample.ts b/sdk/connectedcache/arm-connectedcache/samples-dev/ispCustomersListBySubscriptionSample.ts new file mode 100644 index 00000000000..70e33e5e591 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples-dev/ispCustomersListBySubscriptionSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to this api gets information about all ispCustomer resources under the given subscription + * + * @summary this api gets information about all ispCustomer resources under the given subscription + * x-ms-original-file: 2023-05-01-preview/IspCustomers_ListBySubscription_MaximumSet_Gen.json + */ +async function ispCustomerListBySubscriptionGeneratedByMaximumSetRule() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.ispCustomers.listBySubscription()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + ispCustomerListBySubscriptionGeneratedByMaximumSetRule(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples-dev/ispCustomersUpdateSample.ts b/sdk/connectedcache/arm-connectedcache/samples-dev/ispCustomersUpdateSample.ts new file mode 100644 index 00000000000..8b24fd3143f --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples-dev/ispCustomersUpdateSample.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to this api updates an existing ispCustomer resource + * + * @summary this api updates an existing ispCustomer resource + * x-ms-original-file: 2023-05-01-preview/IspCustomers_Update_MaximumSet_Gen.json + */ +async function ispCustomerUpdateDetailsGeneratedByMaximumSetRule() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const result = await client.ispCustomers.update("rgConnectedCache", "MccRPTest2", { + tags: { key1653: "nzjczrhclhkndesgy" }, + }); + console.log(result); +} + +async function main() { + ispCustomerUpdateDetailsGeneratedByMaximumSetRule(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples-dev/operationsListSample.ts b/sdk/connectedcache/arm-connectedcache/samples-dev/operationsListSample.ts new file mode 100644 index 00000000000..913ce5c48be --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples-dev/operationsListSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to list the operations for the provider + * + * @summary list the operations for the provider + * x-ms-original-file: 2023-05-01-preview/Operations_List_MaximumSet_Gen.json + */ +async function listTheOperationsForTheProviderGeneratedByMaximumSetRule() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.operations.list()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + listTheOperationsForTheProviderGeneratedByMaximumSetRule(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/README.md b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/README.md new file mode 100644 index 00000000000..db5ae918ae0 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/README.md @@ -0,0 +1,124 @@ +# @azure/arm-connectedcache client library samples for JavaScript (Beta) + +These sample programs show how to use the JavaScript client libraries for @azure/arm-connectedcache in some common scenarios. + +| **File Name** | **Description** | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| [cacheNodesOperationsCreateorUpdateSample.js][cachenodesoperationscreateorupdatesample] | creates a cacheNodes with the specified create parameters x-ms-original-file: 2023-05-01-preview/CacheNodesOperations_CreateorUpdate_MaximumSet_Gen.json | +| [cacheNodesOperationsDeleteSample.js][cachenodesoperationsdeletesample] | deletes an existing cache Node x-ms-original-file: 2023-05-01-preview/CacheNodesOperations_Delete_MaximumSet_Gen.json | +| [cacheNodesOperationsGetSample.js][cachenodesoperationsgetsample] | retrieves the properties of a cacheNodes x-ms-original-file: 2023-05-01-preview/CacheNodesOperations_Get_MaximumSet_Gen.json | +| [cacheNodesOperationsListByResourceGroupSample.js][cachenodesoperationslistbyresourcegroupsample] | retrieves the properties of all ConnectedCache x-ms-original-file: 2023-05-01-preview/CacheNodesOperations_ListByResourceGroup_MaximumSet_Gen.json | +| [cacheNodesOperationsListBySubscriptionSample.js][cachenodesoperationslistbysubscriptionsample] | retrieves the properties of all ConnectedCaches x-ms-original-file: 2023-05-01-preview/CacheNodesOperations_ListBySubscription_MaximumSet_Gen.json | +| [cacheNodesOperationsUpdateSample.js][cachenodesoperationsupdatesample] | updates an existing Cache Node x-ms-original-file: 2023-05-01-preview/CacheNodesOperations_Update_MaximumSet_Gen.json | +| [enterpriseCustomerOperationsCreateOrUpdateSample.js][enterprisecustomeroperationscreateorupdatesample] | creates a cacheNodes with the specified create parameters x-ms-original-file: 2023-05-01-preview/EnterpriseCustomerOperations_CreateOrUpdate_MaximumSet_Gen.json | +| [enterpriseCustomerOperationsDeleteSample.js][enterprisecustomeroperationsdeletesample] | deletes an existing customer Enterprise resource x-ms-original-file: 2023-05-01-preview/EnterpriseCustomerOperations_Delete_MaximumSet_Gen.json | +| [enterpriseCustomerOperationsGetSample.js][enterprisecustomeroperationsgetsample] | retrieves the properties of a Enterprise customer x-ms-original-file: 2023-05-01-preview/EnterpriseCustomerOperations_Get_MaximumSet_Gen.json | +| [enterpriseCustomerOperationsListByResourceGroupSample.js][enterprisecustomeroperationslistbyresourcegroupsample] | retrieves the properties of all ConnectedCache enterpriseCustomers x-ms-original-file: 2023-05-01-preview/EnterpriseCustomerOperations_ListByResourceGroup_MaximumSet_Gen.json | +| [enterpriseCustomerOperationsListBySubscriptionSample.js][enterprisecustomeroperationslistbysubscriptionsample] | retrieves the properties of all ConnectedCaches x-ms-original-file: 2023-05-01-preview/EnterpriseCustomerOperations_ListBySubscription_MaximumSet_Gen.json | +| [enterpriseCustomerOperationsUpdateSample.js][enterprisecustomeroperationsupdatesample] | updates an existing enterpriseCustomers x-ms-original-file: 2023-05-01-preview/EnterpriseCustomerOperations_Update_MaximumSet_Gen.json | +| [enterpriseMccCacheNodesOperationsCreateOrUpdateSample.js][enterprisemcccachenodesoperationscreateorupdatesample] | this api creates an ispCacheNode with the specified create parameters x-ms-original-file: 2023-05-01-preview/EnterpriseMccCacheNodesOperations_CreateOrUpdate_MaximumSet_Gen.json | +| [enterpriseMccCacheNodesOperationsDeleteSample.js][enterprisemcccachenodesoperationsdeletesample] | this api deletes an existing ispCacheNode resource x-ms-original-file: 2023-05-01-preview/EnterpriseMccCacheNodesOperations_Delete_MaximumSet_Gen.json | +| [enterpriseMccCacheNodesOperationsGetCacheNodeInstallDetailsSample.js][enterprisemcccachenodesoperationsgetcachenodeinstalldetailssample] | this api gets secrets of the ispCacheNode resource install details x-ms-original-file: 2023-05-01-preview/EnterpriseMccCacheNodesOperations_GetCacheNodeInstallDetails_MaximumSet_Gen.json | +| [enterpriseMccCacheNodesOperationsGetSample.js][enterprisemcccachenodesoperationsgetsample] | this api gets ispCacheNode resource information x-ms-original-file: 2023-05-01-preview/EnterpriseMccCacheNodesOperations_Get_MaximumSet_Gen.json | +| [enterpriseMccCacheNodesOperationsListByEnterpriseMccCustomerResourceSample.js][enterprisemcccachenodesoperationslistbyenterprisemcccustomerresourcesample] | this api retrieves information about all ispCacheNode resources under the given subscription and resource group x-ms-original-file: 2023-05-01-preview/EnterpriseMccCacheNodesOperations_ListByEnterpriseMccCustomerResource_MaximumSet_Gen.json | +| [enterpriseMccCacheNodesOperationsUpdateSample.js][enterprisemcccachenodesoperationsupdatesample] | this api updates an existing ispCacheNode resource x-ms-original-file: 2023-05-01-preview/EnterpriseMccCacheNodesOperations_Update_MaximumSet_Gen.json | +| [enterpriseMccCustomersCreateOrUpdateSample.js][enterprisemcccustomerscreateorupdatesample] | this api creates an enterprise mcc customer with the specified create parameters x-ms-original-file: 2023-05-01-preview/EnterpriseMccCustomers_CreateOrUpdate_MaximumSet_Gen.json | +| [enterpriseMccCustomersDeleteSample.js][enterprisemcccustomersdeletesample] | this api deletes an existing enterprise mcc customer resource x-ms-original-file: 2023-05-01-preview/EnterpriseMccCustomers_Delete_MaximumSet_Gen.json | +| [enterpriseMccCustomersGetSample.js][enterprisemcccustomersgetsample] | gets the enterprise mcc customer resource information using this get call x-ms-original-file: 2023-05-01-preview/EnterpriseMccCustomers_Get_MaximumSet_Gen.json | +| [enterpriseMccCustomersListByResourceGroupSample.js][enterprisemcccustomerslistbyresourcegroupsample] | this api gets the information about all enterprise mcc customer resources under the given subscription and resource group x-ms-original-file: 2023-05-01-preview/EnterpriseMccCustomers_ListByResourceGroup_MaximumSet_Gen.json | +| [enterpriseMccCustomersListBySubscriptionSample.js][enterprisemcccustomerslistbysubscriptionsample] | this api gets information about all enterpriseMccCustomer resources under the given subscription x-ms-original-file: 2023-05-01-preview/EnterpriseMccCustomers_ListBySubscription_MaximumSet_Gen.json | +| [enterpriseMccCustomersUpdateSample.js][enterprisemcccustomersupdatesample] | this api updates an existing enterprise mcc customer resource x-ms-original-file: 2023-05-01-preview/EnterpriseMccCustomers_Update_MaximumSet_Gen.json | +| [ispCacheNodesOperationsCreateOrUpdateSample.js][ispcachenodesoperationscreateorupdatesample] | this api creates an ispCacheNode with the specified create parameters x-ms-original-file: 2023-05-01-preview/IspCacheNodesOperations_CreateOrUpdate_MaximumSet_Gen.json | +| [ispCacheNodesOperationsDeleteSample.js][ispcachenodesoperationsdeletesample] | this api deletes an existing ispCacheNode resource x-ms-original-file: 2023-05-01-preview/IspCacheNodesOperations_Delete_MaximumSet_Gen.json | +| [ispCacheNodesOperationsGetBgpCidrsSample.js][ispcachenodesoperationsgetbgpcidrssample] | this api gets ispCacheNode resource information x-ms-original-file: 2023-05-01-preview/IspCacheNodesOperations_GetBgpCidrs_MaximumSet_Gen.json | +| [ispCacheNodesOperationsGetCacheNodeInstallDetailsSample.js][ispcachenodesoperationsgetcachenodeinstalldetailssample] | this api gets secrets of the ispCacheNode resource install details x-ms-original-file: 2023-05-01-preview/IspCacheNodesOperations_GetCacheNodeInstallDetails_MaximumSet_Gen.json | +| [ispCacheNodesOperationsGetSample.js][ispcachenodesoperationsgetsample] | this api gets ispCacheNode resource information x-ms-original-file: 2023-05-01-preview/IspCacheNodesOperations_Get_MaximumSet_Gen.json | +| [ispCacheNodesOperationsListByIspCustomerResourceSample.js][ispcachenodesoperationslistbyispcustomerresourcesample] | this api retrieves information about all ispCacheNode resources under the given subscription and resource group x-ms-original-file: 2023-05-01-preview/IspCacheNodesOperations_ListByIspCustomerResource_MaximumSet_Gen.json | +| [ispCacheNodesOperationsUpdateSample.js][ispcachenodesoperationsupdatesample] | this api updates an existing ispCacheNode resource x-ms-original-file: 2023-05-01-preview/IspCacheNodesOperations_Update_MaximumSet_Gen.json | +| [ispCustomersCreateOrUpdateSample.js][ispcustomerscreateorupdatesample] | this api creates an ispCustomer with the specified create parameters x-ms-original-file: 2023-05-01-preview/IspCustomers_CreateOrUpdate_MaximumSet_Gen.json | +| [ispCustomersDeleteSample.js][ispcustomersdeletesample] | this api deletes an existing ispCustomer resource x-ms-original-file: 2023-05-01-preview/IspCustomers_Delete_MaximumSet_Gen.json | +| [ispCustomersGetSample.js][ispcustomersgetsample] | gets the ispCustomer resource information using this get call x-ms-original-file: 2023-05-01-preview/IspCustomers_Get_MaximumSet_Gen.json | +| [ispCustomersListByResourceGroupSample.js][ispcustomerslistbyresourcegroupsample] | this api gets the information about all ispCustomer resources under the given subscription and resource group x-ms-original-file: 2023-05-01-preview/IspCustomers_ListByResourceGroup_MaximumSet_Gen.json | +| [ispCustomersListBySubscriptionSample.js][ispcustomerslistbysubscriptionsample] | this api gets information about all ispCustomer resources under the given subscription x-ms-original-file: 2023-05-01-preview/IspCustomers_ListBySubscription_MaximumSet_Gen.json | +| [ispCustomersUpdateSample.js][ispcustomersupdatesample] | this api updates an existing ispCustomer resource x-ms-original-file: 2023-05-01-preview/IspCustomers_Update_MaximumSet_Gen.json | +| [operationsListSample.js][operationslistsample] | list the operations for the provider x-ms-original-file: 2023-05-01-preview/Operations_List_MaximumSet_Gen.json | + +## Prerequisites + +The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). + +You need [an Azure subscription][freesub] to run these sample programs. + +Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. + +Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. + +## Setup + +To run the samples using the published version of the package: + +1. Install the dependencies using `npm`: + +```bash +npm install +``` + +2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. + +3. Run whichever samples you like (note that some samples may require additional setup, see the table above): + +```bash +node cacheNodesOperationsCreateorUpdateSample.js +``` + +Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): + +```bash +npx dev-tool run vendored cross-env node cacheNodesOperationsCreateorUpdateSample.js +``` + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +[cachenodesoperationscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/cacheNodesOperationsCreateorUpdateSample.js +[cachenodesoperationsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/cacheNodesOperationsDeleteSample.js +[cachenodesoperationsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/cacheNodesOperationsGetSample.js +[cachenodesoperationslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/cacheNodesOperationsListByResourceGroupSample.js +[cachenodesoperationslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/cacheNodesOperationsListBySubscriptionSample.js +[cachenodesoperationsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/cacheNodesOperationsUpdateSample.js +[enterprisecustomeroperationscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseCustomerOperationsCreateOrUpdateSample.js +[enterprisecustomeroperationsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseCustomerOperationsDeleteSample.js +[enterprisecustomeroperationsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseCustomerOperationsGetSample.js +[enterprisecustomeroperationslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseCustomerOperationsListByResourceGroupSample.js +[enterprisecustomeroperationslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseCustomerOperationsListBySubscriptionSample.js +[enterprisecustomeroperationsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseCustomerOperationsUpdateSample.js +[enterprisemcccachenodesoperationscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseMccCacheNodesOperationsCreateOrUpdateSample.js +[enterprisemcccachenodesoperationsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseMccCacheNodesOperationsDeleteSample.js +[enterprisemcccachenodesoperationsgetcachenodeinstalldetailssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseMccCacheNodesOperationsGetCacheNodeInstallDetailsSample.js +[enterprisemcccachenodesoperationsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseMccCacheNodesOperationsGetSample.js +[enterprisemcccachenodesoperationslistbyenterprisemcccustomerresourcesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseMccCacheNodesOperationsListByEnterpriseMccCustomerResourceSample.js +[enterprisemcccachenodesoperationsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseMccCacheNodesOperationsUpdateSample.js +[enterprisemcccustomerscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseMccCustomersCreateOrUpdateSample.js +[enterprisemcccustomersdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseMccCustomersDeleteSample.js +[enterprisemcccustomersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseMccCustomersGetSample.js +[enterprisemcccustomerslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseMccCustomersListByResourceGroupSample.js +[enterprisemcccustomerslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseMccCustomersListBySubscriptionSample.js +[enterprisemcccustomersupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseMccCustomersUpdateSample.js +[ispcachenodesoperationscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCacheNodesOperationsCreateOrUpdateSample.js +[ispcachenodesoperationsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCacheNodesOperationsDeleteSample.js +[ispcachenodesoperationsgetbgpcidrssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCacheNodesOperationsGetBgpCidrsSample.js +[ispcachenodesoperationsgetcachenodeinstalldetailssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCacheNodesOperationsGetCacheNodeInstallDetailsSample.js +[ispcachenodesoperationsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCacheNodesOperationsGetSample.js +[ispcachenodesoperationslistbyispcustomerresourcesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCacheNodesOperationsListByIspCustomerResourceSample.js +[ispcachenodesoperationsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCacheNodesOperationsUpdateSample.js +[ispcustomerscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCustomersCreateOrUpdateSample.js +[ispcustomersdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCustomersDeleteSample.js +[ispcustomersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCustomersGetSample.js +[ispcustomerslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCustomersListByResourceGroupSample.js +[ispcustomerslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCustomersListBySubscriptionSample.js +[ispcustomersupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCustomersUpdateSample.js +[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/operationsListSample.js +[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-connectedcache?view=azure-node-preview +[freesub]: https://azure.microsoft.com/free/ +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/connectedcache/arm-connectedcache/README.md diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/cacheNodesOperationsCreateorUpdateSample.js b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/cacheNodesOperationsCreateorUpdateSample.js new file mode 100644 index 00000000000..ec80edd45fe --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/cacheNodesOperationsCreateorUpdateSample.js @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ConnectedCacheClient } = require("@azure/arm-connectedcache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to creates a cacheNodes with the specified create parameters + * + * @summary creates a cacheNodes with the specified create parameters + * x-ms-original-file: 2023-05-01-preview/CacheNodesOperations_CreateorUpdate_MaximumSet_Gen.json + */ +async function cacheNodesOperationsCreateorUpdate() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const result = await client.cacheNodesOperations.createorUpdate( + "rgConnectedCache", + "lwrsyhvfpcfrwrim", + { + location: "westus", + properties: { + statusCode: "movtzupooyhdqk", + statusText: "bjnsrpzaofjntleoesjwammgbi", + statusDetails: "quuziibkwtgf", + error: {}, + }, + tags: { key8256: "oreqiywrjkmate" }, + }, + ); + console.log(result); +} + +async function main() { + cacheNodesOperationsCreateorUpdate(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/cacheNodesOperationsDeleteSample.js b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/cacheNodesOperationsDeleteSample.js new file mode 100644 index 00000000000..ebfe0cd305c --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/cacheNodesOperationsDeleteSample.js @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ConnectedCacheClient } = require("@azure/arm-connectedcache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to deletes an existing cache Node + * + * @summary deletes an existing cache Node + * x-ms-original-file: 2023-05-01-preview/CacheNodesOperations_Delete_MaximumSet_Gen.json + */ +async function cacheNodesOperationsDelete() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + await client.cacheNodesOperations.delete( + "rgConnectedCache", + "otvtvhmovthjwzjzbsqkbnmpcmmeianpqxmmaspvdczmrenquxigrtuarmlcmvsnaclhcbw", + ); +} + +async function main() { + cacheNodesOperationsDelete(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/cacheNodesOperationsGetSample.js b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/cacheNodesOperationsGetSample.js new file mode 100644 index 00000000000..6dd50adbe10 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/cacheNodesOperationsGetSample.js @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ConnectedCacheClient } = require("@azure/arm-connectedcache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to retrieves the properties of a cacheNodes + * + * @summary retrieves the properties of a cacheNodes + * x-ms-original-file: 2023-05-01-preview/CacheNodesOperations_Get_MaximumSet_Gen.json + */ +async function cacheNodesOperationsGet() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const result = await client.cacheNodesOperations.get( + "rgConnectedCache", + "nqoxkgorhuzbhjwcegymzqbeydzjupemekt", + ); + console.log(result); +} + +async function main() { + cacheNodesOperationsGet(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/cacheNodesOperationsListByResourceGroupSample.js b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/cacheNodesOperationsListByResourceGroupSample.js new file mode 100644 index 00000000000..6008f32c415 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/cacheNodesOperationsListByResourceGroupSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ConnectedCacheClient } = require("@azure/arm-connectedcache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to retrieves the properties of all ConnectedCache + * + * @summary retrieves the properties of all ConnectedCache + * x-ms-original-file: 2023-05-01-preview/CacheNodesOperations_ListByResourceGroup_MaximumSet_Gen.json + */ +async function cacheNodesPrivatePreviewLegacyGetOperationListByResourceGroupGeneratedByMaximumSetRule() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.cacheNodesOperations.listByResourceGroup("rgConnectedCache")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + cacheNodesPrivatePreviewLegacyGetOperationListByResourceGroupGeneratedByMaximumSetRule(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/cacheNodesOperationsListBySubscriptionSample.js b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/cacheNodesOperationsListBySubscriptionSample.js new file mode 100644 index 00000000000..5e6f43483bc --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/cacheNodesOperationsListBySubscriptionSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ConnectedCacheClient } = require("@azure/arm-connectedcache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to retrieves the properties of all ConnectedCaches + * + * @summary retrieves the properties of all ConnectedCaches + * x-ms-original-file: 2023-05-01-preview/CacheNodesOperations_ListBySubscription_MaximumSet_Gen.json + */ +async function cacheNodesPrivatePreviewLegacyResourceListBySubscriptionGeneratedByMaximumSetRule() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.cacheNodesOperations.listBySubscription()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + cacheNodesPrivatePreviewLegacyResourceListBySubscriptionGeneratedByMaximumSetRule(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/cacheNodesOperationsUpdateSample.js b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/cacheNodesOperationsUpdateSample.js new file mode 100644 index 00000000000..01acab46fe7 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/cacheNodesOperationsUpdateSample.js @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ConnectedCacheClient } = require("@azure/arm-connectedcache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to updates an existing Cache Node + * + * @summary updates an existing Cache Node + * x-ms-original-file: 2023-05-01-preview/CacheNodesOperations_Update_MaximumSet_Gen.json + */ +async function cacheNodesPrivatePreviewLegacyUpdateOperationGeneratedByMaximumSetRule() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const result = await client.cacheNodesOperations.update("rgConnectedCache", "wlrwpdbcv", { + tags: { key5032: "esiuyjbpcwkpqriqiqztxuocv" }, + }); + console.log(result); +} + +async function main() { + cacheNodesPrivatePreviewLegacyUpdateOperationGeneratedByMaximumSetRule(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseCustomerOperationsCreateOrUpdateSample.js b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseCustomerOperationsCreateOrUpdateSample.js new file mode 100644 index 00000000000..ea86f5cedef --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseCustomerOperationsCreateOrUpdateSample.js @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ConnectedCacheClient } = require("@azure/arm-connectedcache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to creates a cacheNodes with the specified create parameters + * + * @summary creates a cacheNodes with the specified create parameters + * x-ms-original-file: 2023-05-01-preview/EnterpriseCustomerOperations_CreateOrUpdate_MaximumSet_Gen.json + */ +async function enterpriseCustomerOperationsCreateOrUpdate() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const result = await client.enterpriseCustomerOperations.createOrUpdate("rgConnectedCache", "l", { + properties: { + statusCode: "oldkroffqtkryqffpsi", + statusText: "bs", + statusDetails: "lhwvcz", + error: {}, + }, + tags: { key4215: "zjbszvlzf" }, + location: "zdzhhkjyogrqxwihkifnmeyhwpujbr", + }); + console.log(result); +} + +async function main() { + enterpriseCustomerOperationsCreateOrUpdate(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseCustomerOperationsDeleteSample.js b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseCustomerOperationsDeleteSample.js new file mode 100644 index 00000000000..6ce9d67d85e --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseCustomerOperationsDeleteSample.js @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ConnectedCacheClient } = require("@azure/arm-connectedcache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to deletes an existing customer Enterprise resource + * + * @summary deletes an existing customer Enterprise resource + * x-ms-original-file: 2023-05-01-preview/EnterpriseCustomerOperations_Delete_MaximumSet_Gen.json + */ +async function enterpriseCustomerOperationsDelete() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + await client.enterpriseCustomerOperations.delete( + "rgConnectedCache", + "jeubxmhiaihcusgnahblvvckbdcetacvqgwbohlrqucodtlwuyefpejskvamgrdnwgucziodcfpjhqy", + ); +} + +async function main() { + enterpriseCustomerOperationsDelete(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseCustomerOperationsGetSample.js b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseCustomerOperationsGetSample.js new file mode 100644 index 00000000000..9caac6cd74f --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseCustomerOperationsGetSample.js @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ConnectedCacheClient } = require("@azure/arm-connectedcache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to retrieves the properties of a Enterprise customer + * + * @summary retrieves the properties of a Enterprise customer + * x-ms-original-file: 2023-05-01-preview/EnterpriseCustomerOperations_Get_MaximumSet_Gen.json + */ +async function enterpriseCustomerOperationsGet() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const result = await client.enterpriseCustomerOperations.get("rgConnectedCache", "MCCTPTest2"); + console.log(result); +} + +async function main() { + enterpriseCustomerOperationsGet(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseCustomerOperationsListByResourceGroupSample.js b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseCustomerOperationsListByResourceGroupSample.js new file mode 100644 index 00000000000..a4b80433ece --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseCustomerOperationsListByResourceGroupSample.js @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ConnectedCacheClient } = require("@azure/arm-connectedcache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to retrieves the properties of all ConnectedCache enterpriseCustomers + * + * @summary retrieves the properties of all ConnectedCache enterpriseCustomers + * x-ms-original-file: 2023-05-01-preview/EnterpriseCustomerOperations_ListByResourceGroup_MaximumSet_Gen.json + */ +async function enterpriseCustomerOperationsListByResourceGroup() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.enterpriseCustomerOperations.listByResourceGroup( + "rgConnectedCache", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + enterpriseCustomerOperationsListByResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseCustomerOperationsListBySubscriptionSample.js b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseCustomerOperationsListBySubscriptionSample.js new file mode 100644 index 00000000000..04f3b97d0da --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseCustomerOperationsListBySubscriptionSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ConnectedCacheClient } = require("@azure/arm-connectedcache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to retrieves the properties of all ConnectedCaches + * + * @summary retrieves the properties of all ConnectedCaches + * x-ms-original-file: 2023-05-01-preview/EnterpriseCustomerOperations_ListBySubscription_MaximumSet_Gen.json + */ +async function enterpriseCustomerOperationsListBySubscription() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.enterpriseCustomerOperations.listBySubscription()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + enterpriseCustomerOperationsListBySubscription(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseCustomerOperationsUpdateSample.js b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseCustomerOperationsUpdateSample.js new file mode 100644 index 00000000000..505dff1f630 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseCustomerOperationsUpdateSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ConnectedCacheClient } = require("@azure/arm-connectedcache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to updates an existing enterpriseCustomers + * + * @summary updates an existing enterpriseCustomers + * x-ms-original-file: 2023-05-01-preview/EnterpriseCustomerOperations_Update_MaximumSet_Gen.json + */ +async function enterpriseCustomerOperationsUpdate() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const result = await client.enterpriseCustomerOperations.update( + "rgConnectedCache", + "MCCTPTest2", + { tags: { key1653: "nzjczrhclhkndesgy" } }, + ); + console.log(result); +} + +async function main() { + enterpriseCustomerOperationsUpdate(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseMccCacheNodesOperationsCreateOrUpdateSample.js b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseMccCacheNodesOperationsCreateOrUpdateSample.js new file mode 100644 index 00000000000..aa9e6a8ba2c --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseMccCacheNodesOperationsCreateOrUpdateSample.js @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ConnectedCacheClient } = require("@azure/arm-connectedcache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to this api creates an ispCacheNode with the specified create parameters + * + * @summary this api creates an ispCacheNode with the specified create parameters + * x-ms-original-file: 2023-05-01-preview/EnterpriseMccCacheNodesOperations_CreateOrUpdate_MaximumSet_Gen.json + */ +async function createsAnEnterpriseMccCacheNodeResourceGeneratedByMaximumSetRule() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const result = await client.enterpriseMccCacheNodesOperations.createOrUpdate( + "rgConnectedCache", + "nhdkvstdrrtsxxuz", + "fgduqdovidpemlnmhelomffuafdrbgaasqznvrdkbvspfzsnrhncdtqquhijhdpwyzwleukqldpceyxqhqlftqrr", + { + location: "westus", + properties: { + cacheNode: { + fullyQualifiedResourceId: "yeinlleavzbehelhsucb", + customerName: "zsklcocjfjhkcpmzyefzkwamdzc", + ipAddress: "gbfkdhloyphnpnhemwrcrxlk", + customerIndex: "vafvezmelfgmjsrccjukrhppljvipg", + cacheNodeId: "fmrjefyddfn", + cacheNodeName: "qppvqxliajjfoalzjbgmxggr", + customerAsn: 25, + isEnabled: true, + maxAllowableEgressInMbps: 27, + isEnterpriseManaged: true, + cidrCsv: ["nlqlvrthafvvljuupcbcw"], + shouldMigrate: true, + cidrSelectionType: 11, + }, + statusCode: "1", + statusText: "Success", + statusDetails: "lgljxmyyoakw", + additionalCacheNodeProperties: { + cacheNodePropertiesDetailsIssuesList: ["ennbzfpuszgalzpawmwicaofqcwcj"], + driveConfiguration: [ + { + physicalPath: "pcbkezoofhamkycot", + sizeInGb: 14, + cacheNumber: 11, + nginxMapping: "cirlpkpuxg", + }, + ], + bgpConfiguration: { asnToIpAddressMapping: "fjbggfvumrn" }, + proxyUrlConfiguration: { proxyUrl: "hplstyg" }, + proxyUrl: "ihkzxlzvpcywtzrogupqozkdud", + optionalProperty1: "ph", + optionalProperty2: "soqqgpgcbhb", + optionalProperty3: "fpnycrbagptsujiotnjfuhlm", + optionalProperty4: "gesqugrxvhxlxxyvatgrautxwlmxsf", + optionalProperty5: "zknjgzpaqtvdqjydd", + }, + error: {}, + }, + tags: { key259: "qbkixjuyjkoj" }, + }, + ); + console.log(result); +} + +async function main() { + createsAnEnterpriseMccCacheNodeResourceGeneratedByMaximumSetRule(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseMccCacheNodesOperationsDeleteSample.js b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseMccCacheNodesOperationsDeleteSample.js new file mode 100644 index 00000000000..d6b7e322a03 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseMccCacheNodesOperationsDeleteSample.js @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ConnectedCacheClient } = require("@azure/arm-connectedcache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to this api deletes an existing ispCacheNode resource + * + * @summary this api deletes an existing ispCacheNode resource + * x-ms-original-file: 2023-05-01-preview/EnterpriseMccCacheNodesOperations_Delete_MaximumSet_Gen.json + */ +async function enterpriseMccCacheNodesOperationsDeleteOperationGeneratedByMaximumSetRule() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + await client.enterpriseMccCacheNodesOperations.delete( + "rgConnectedCache", + "hsincngmssuzeyispnufqwinpopadvhsbsemisguxgovwdjwviqexocelijvuyr", + "vwtrhdoxvkrunpliwcao", + ); +} + +async function main() { + enterpriseMccCacheNodesOperationsDeleteOperationGeneratedByMaximumSetRule(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseMccCacheNodesOperationsGetCacheNodeInstallDetailsSample.js b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseMccCacheNodesOperationsGetCacheNodeInstallDetailsSample.js new file mode 100644 index 00000000000..cd4eac61a5a --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseMccCacheNodesOperationsGetCacheNodeInstallDetailsSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ConnectedCacheClient } = require("@azure/arm-connectedcache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to this api gets secrets of the ispCacheNode resource install details + * + * @summary this api gets secrets of the ispCacheNode resource install details + * x-ms-original-file: 2023-05-01-preview/EnterpriseMccCacheNodesOperations_GetCacheNodeInstallDetails_MaximumSet_Gen.json + */ +async function getsRequiredPropertiesForEnterpriseMccCacheNodeResourceInstallKeyDetailsGeneratedByMaximumSetRule() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const result = await client.enterpriseMccCacheNodesOperations.getCacheNodeInstallDetails( + "rgConnectedCache", + "fzwxcjmdpxxzayecabqqlh", + "ccexmqqttritxvtctivraso", + ); + console.log(result); +} + +async function main() { + getsRequiredPropertiesForEnterpriseMccCacheNodeResourceInstallKeyDetailsGeneratedByMaximumSetRule(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseMccCacheNodesOperationsGetSample.js b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseMccCacheNodesOperationsGetSample.js new file mode 100644 index 00000000000..fd8605e3a45 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseMccCacheNodesOperationsGetSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ConnectedCacheClient } = require("@azure/arm-connectedcache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to this api gets ispCacheNode resource information + * + * @summary this api gets ispCacheNode resource information + * x-ms-original-file: 2023-05-01-preview/EnterpriseMccCacheNodesOperations_Get_MaximumSet_Gen.json + */ +async function getsEnterpriseMccCacheNodeResourceInformationOfAnEnterpriseMccCustomerParentResourceGeneratedByMaximumSetRule() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const result = await client.enterpriseMccCacheNodesOperations.get( + "rgConnectedCache", + "cygqjgtcetihsajgyqwwrbclssqsvhgltrboemcqqtpoxdbhykqxblaihmrumyhbsx", + "fqxfadsultwjfzdwlqkvneakfsbyhratytmssmiukpbnus", + ); + console.log(result); +} + +async function main() { + getsEnterpriseMccCacheNodeResourceInformationOfAnEnterpriseMccCustomerParentResourceGeneratedByMaximumSetRule(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseMccCacheNodesOperationsListByEnterpriseMccCustomerResourceSample.js b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseMccCacheNodesOperationsListByEnterpriseMccCustomerResourceSample.js new file mode 100644 index 00000000000..f422314a30b --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseMccCacheNodesOperationsListByEnterpriseMccCustomerResourceSample.js @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ConnectedCacheClient } = require("@azure/arm-connectedcache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to this api retrieves information about all ispCacheNode resources under the given subscription and resource group + * + * @summary this api retrieves information about all ispCacheNode resources under the given subscription and resource group + * x-ms-original-file: 2023-05-01-preview/EnterpriseMccCacheNodesOperations_ListByEnterpriseMccCustomerResource_MaximumSet_Gen.json + */ +async function enterpriseMccCacheNodesOperationsListByEnterpriseMccCustomerResource() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.enterpriseMccCacheNodesOperations.listByEnterpriseMccCustomerResource( + "rgConnectedCache", + "syjjjzk", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + enterpriseMccCacheNodesOperationsListByEnterpriseMccCustomerResource(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseMccCacheNodesOperationsUpdateSample.js b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseMccCacheNodesOperationsUpdateSample.js new file mode 100644 index 00000000000..3b94d7909a8 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseMccCacheNodesOperationsUpdateSample.js @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ConnectedCacheClient } = require("@azure/arm-connectedcache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to this api updates an existing ispCacheNode resource + * + * @summary this api updates an existing ispCacheNode resource + * x-ms-original-file: 2023-05-01-preview/EnterpriseMccCacheNodesOperations_Update_MaximumSet_Gen.json + */ +async function enterpriseMccCacheNodesOperationsUpdateGeneratedByMaximumSetRule() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const result = await client.enterpriseMccCacheNodesOperations.update( + "rgConnectedCache", + "qanjqtvrxzjkljdysdjvdiqcxkttskpdzykzuefhbhz", + "kllmlvazrcxmfjfozulzqnsgvspgwmhogcafvauchunlgfr", + { tags: { key1653: "nzjczrhclhkndesgy" } }, + ); + console.log(result); +} + +async function main() { + enterpriseMccCacheNodesOperationsUpdateGeneratedByMaximumSetRule(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseMccCustomersCreateOrUpdateSample.js b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseMccCustomersCreateOrUpdateSample.js new file mode 100644 index 00000000000..ebb81e88a6d --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseMccCustomersCreateOrUpdateSample.js @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ConnectedCacheClient } = require("@azure/arm-connectedcache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to this api creates an enterprise mcc customer with the specified create parameters + * + * @summary this api creates an enterprise mcc customer with the specified create parameters + * x-ms-original-file: 2023-05-01-preview/EnterpriseMccCustomers_CreateOrUpdate_MaximumSet_Gen.json + */ +async function enterpriseMccCustomersCreateOrUpdate() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const result = await client.enterpriseMccCustomers.createOrUpdate( + "rgConnectedCache", + "MccRPTest1", + { + properties: { + customer: { + fullyQualifiedResourceId: "uqsbtgae", + customerName: "mkpzynfqihnjfdbaqbqwyhd", + contactEmail: "xquos", + contactPhone: "vue", + contactName: "wxyqjoyoscmvimgwhpitxky", + isEntitled: true, + releaseVersion: 20, + clientTenantId: "fproidkpgvpdnac", + isEnterpriseManaged: true, + shouldMigrate: true, + resendSignupCode: true, + verifySignupCode: true, + verifySignupPhrase: "tprjvttkgmrqlsyicnidhm", + }, + additionalCustomerProperties: { + customerEmail: "zdjgibsidydyzm", + customerTransitAsn: "habgklnxqzmozqpazoyejwiphezpi", + customerAsn: "hgrelgnrtdkleisnepfolu", + customerEntitlementSkuId: "b", + customerEntitlementSkuGuid: "rvzmdpxyflgqetvpwupnfaxsweiiz", + customerEntitlementSkuName: "waaqfijr", + customerEntitlementExpiration: new Date("2024-01-30T00:54:04.773Z"), + optionalProperty1: "qhmwxza", + optionalProperty2: "l", + optionalProperty3: "mblwwvbie", + optionalProperty4: "vzuek", + optionalProperty5: "fzjodscdfcdr", + }, + error: {}, + }, + tags: { key3379: "dpyqeaqhcnutzezom" }, + location: "westus", + }, + ); + console.log(result); +} + +async function main() { + enterpriseMccCustomersCreateOrUpdate(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseMccCustomersDeleteSample.js b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseMccCustomersDeleteSample.js new file mode 100644 index 00000000000..df1213de012 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseMccCustomersDeleteSample.js @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ConnectedCacheClient } = require("@azure/arm-connectedcache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to this api deletes an existing enterprise mcc customer resource + * + * @summary this api deletes an existing enterprise mcc customer resource + * x-ms-original-file: 2023-05-01-preview/EnterpriseMccCustomers_Delete_MaximumSet_Gen.json + */ +async function enterpriseMccCustomersDelete() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + await client.enterpriseMccCustomers.delete("rgConnectedCache", "zktb"); +} + +async function main() { + enterpriseMccCustomersDelete(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseMccCustomersGetSample.js b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseMccCustomersGetSample.js new file mode 100644 index 00000000000..0d926e538ac --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseMccCustomersGetSample.js @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ConnectedCacheClient } = require("@azure/arm-connectedcache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to gets the enterprise mcc customer resource information using this get call + * + * @summary gets the enterprise mcc customer resource information using this get call + * x-ms-original-file: 2023-05-01-preview/EnterpriseMccCustomers_Get_MaximumSet_Gen.json + */ +async function enterpriseMccCustomersGet() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const result = await client.enterpriseMccCustomers.get( + "rgConnectedCache", + "pvilvqkofbjbykupeewgvzlmjao", + ); + console.log(result); +} + +async function main() { + enterpriseMccCustomersGet(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseMccCustomersListByResourceGroupSample.js b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseMccCustomersListByResourceGroupSample.js new file mode 100644 index 00000000000..5d93bd1318c --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseMccCustomersListByResourceGroupSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ConnectedCacheClient } = require("@azure/arm-connectedcache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to this api gets the information about all enterprise mcc customer resources under the given subscription and resource group + * + * @summary this api gets the information about all enterprise mcc customer resources under the given subscription and resource group + * x-ms-original-file: 2023-05-01-preview/EnterpriseMccCustomers_ListByResourceGroup_MaximumSet_Gen.json + */ +async function enterpriseMccCustomersListByResourceGroup() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.enterpriseMccCustomers.listByResourceGroup("rgConnectedCache")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + enterpriseMccCustomersListByResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseMccCustomersListBySubscriptionSample.js b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseMccCustomersListBySubscriptionSample.js new file mode 100644 index 00000000000..37e5ecb8389 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseMccCustomersListBySubscriptionSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ConnectedCacheClient } = require("@azure/arm-connectedcache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to this api gets information about all enterpriseMccCustomer resources under the given subscription + * + * @summary this api gets information about all enterpriseMccCustomer resources under the given subscription + * x-ms-original-file: 2023-05-01-preview/EnterpriseMccCustomers_ListBySubscription_MaximumSet_Gen.json + */ +async function enterpriseMccCustomersListBySubscription() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.enterpriseMccCustomers.listBySubscription()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + enterpriseMccCustomersListBySubscription(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseMccCustomersUpdateSample.js b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseMccCustomersUpdateSample.js new file mode 100644 index 00000000000..3d96175f63a --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/enterpriseMccCustomersUpdateSample.js @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ConnectedCacheClient } = require("@azure/arm-connectedcache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to this api updates an existing enterprise mcc customer resource + * + * @summary this api updates an existing enterprise mcc customer resource + * x-ms-original-file: 2023-05-01-preview/EnterpriseMccCustomers_Update_MaximumSet_Gen.json + */ +async function enterpriseMccCustomersUpdate() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const result = await client.enterpriseMccCustomers.update("rgConnectedCache", "MccRPTest1", { + tags: { key1878: "warz" }, + }); + console.log(result); +} + +async function main() { + enterpriseMccCustomersUpdate(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCacheNodesOperationsCreateOrUpdateSample.js b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCacheNodesOperationsCreateOrUpdateSample.js new file mode 100644 index 00000000000..fdb0bb41d88 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCacheNodesOperationsCreateOrUpdateSample.js @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ConnectedCacheClient } = require("@azure/arm-connectedcache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to this api creates an ispCacheNode with the specified create parameters + * + * @summary this api creates an ispCacheNode with the specified create parameters + * x-ms-original-file: 2023-05-01-preview/IspCacheNodesOperations_CreateOrUpdate_MaximumSet_Gen.json + */ +async function ispCacheNodesOperationsCreateOrUpdate() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const result = await client.ispCacheNodesOperations.createOrUpdate( + "rgConnectedCache", + "zpqzbmanlljgmkrthtydrtneavhlnlqkdmviq", + "cabakm", + { + location: "westus", + properties: { + cacheNode: { + fullyQualifiedResourceId: "hskxkpbiqbrbjiwdzrxndru", + customerName: "xwyqk", + ipAddress: "voctagljcwqgcpnionqdcbjk", + customerIndex: "qtoiglqaswivmkjhzogburcxtszmek", + cacheNodeId: "xjzffjftwcgsehanoxsl", + cacheNodeName: "mfjxb", + customerAsn: 4, + isEnabled: true, + maxAllowableEgressInMbps: 29, + isEnterpriseManaged: true, + cidrCsv: ["nlqlvrthafvvljuupcbcw"], + shouldMigrate: true, + cidrSelectionType: 4, + }, + additionalCacheNodeProperties: { + driveConfiguration: [ + { + physicalPath: "/mcc", + sizeInGb: 500, + cacheNumber: 1, + nginxMapping: "lijygenjq", + }, + ], + bgpConfiguration: { asnToIpAddressMapping: "pafcimhoog" }, + cacheNodePropertiesDetailsIssuesList: ["ex"], + proxyUrlConfiguration: { proxyUrl: "hplstyg" }, + proxyUrl: "qhux", + optionalProperty1: "hvpmt", + optionalProperty2: "talanelmsgxvksrzoeeontqkjzbpv", + optionalProperty3: "bxkoxq", + optionalProperty4: "pqlkcekupusoc", + optionalProperty5: "nyvvmrjigqdufzjdvazdca", + }, + statusCode: "1", + statusText: "Success", + statusDetails: "djruqvptzxak", + error: {}, + }, + tags: { key4171: "qtjlszkawsdujzpgohsbw" }, + }, + ); + console.log(result); +} + +async function main() { + ispCacheNodesOperationsCreateOrUpdate(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCacheNodesOperationsDeleteSample.js b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCacheNodesOperationsDeleteSample.js new file mode 100644 index 00000000000..0148f657e60 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCacheNodesOperationsDeleteSample.js @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ConnectedCacheClient } = require("@azure/arm-connectedcache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to this api deletes an existing ispCacheNode resource + * + * @summary this api deletes an existing ispCacheNode resource + * x-ms-original-file: 2023-05-01-preview/IspCacheNodesOperations_Delete_MaximumSet_Gen.json + */ +async function ispCacheNodesDeleteOperationGeneratedByMaximumSetRule() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + await client.ispCacheNodesOperations.delete( + "rgConnectedCache", + "lvpcosvbfxtpzscakewx", + "wsiruvexelltpbouqxvsogqpxdizcwqwfowybncvjunlakjwcpgmqbdbgzjrsmxlkczxnsxfonhnqqa", + ); +} + +async function main() { + ispCacheNodesDeleteOperationGeneratedByMaximumSetRule(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCacheNodesOperationsGetBgpCidrsSample.js b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCacheNodesOperationsGetBgpCidrsSample.js new file mode 100644 index 00000000000..3ca05c76305 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCacheNodesOperationsGetBgpCidrsSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ConnectedCacheClient } = require("@azure/arm-connectedcache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to this api gets ispCacheNode resource information + * + * @summary this api gets ispCacheNode resource information + * x-ms-original-file: 2023-05-01-preview/IspCacheNodesOperations_GetBgpCidrs_MaximumSet_Gen.json + */ +async function ispCacheNodesResourceBgpCidrsDetailsGeneratedByMaximumSetRule() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const result = await client.ispCacheNodesOperations.getBgpCidrs( + "rgConnectedCache", + "MccRPTest1", + "MCCCachenode1", + ); + console.log(result); +} + +async function main() { + ispCacheNodesResourceBgpCidrsDetailsGeneratedByMaximumSetRule(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCacheNodesOperationsGetCacheNodeInstallDetailsSample.js b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCacheNodesOperationsGetCacheNodeInstallDetailsSample.js new file mode 100644 index 00000000000..d30b6dff7c7 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCacheNodesOperationsGetCacheNodeInstallDetailsSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ConnectedCacheClient } = require("@azure/arm-connectedcache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to this api gets secrets of the ispCacheNode resource install details + * + * @summary this api gets secrets of the ispCacheNode resource install details + * x-ms-original-file: 2023-05-01-preview/IspCacheNodesOperations_GetCacheNodeInstallDetails_MaximumSet_Gen.json + */ +async function ispCacheNodeResourceGetInstallDetailsGeneratedByMaximumSetRule() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const result = await client.ispCacheNodesOperations.getCacheNodeInstallDetails( + "rgConnectedCache", + "MccRPTest1", + "MCCCachenode1", + ); + console.log(result); +} + +async function main() { + ispCacheNodeResourceGetInstallDetailsGeneratedByMaximumSetRule(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCacheNodesOperationsGetSample.js b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCacheNodesOperationsGetSample.js new file mode 100644 index 00000000000..16026a7e0a8 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCacheNodesOperationsGetSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ConnectedCacheClient } = require("@azure/arm-connectedcache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to this api gets ispCacheNode resource information + * + * @summary this api gets ispCacheNode resource information + * x-ms-original-file: 2023-05-01-preview/IspCacheNodesOperations_Get_MaximumSet_Gen.json + */ +async function ispCacheNodesGetResourceGeneratedByMaximumSetRule() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const result = await client.ispCacheNodesOperations.get( + "rgConnectedCache", + "sgtqjsitdrskmgyrrkntszwrrjjkretscpjgaezraucvcwececlelcsorfunrnvxyxcsrg", + "lbsziwmudcjnwnwy", + ); + console.log(result); +} + +async function main() { + ispCacheNodesGetResourceGeneratedByMaximumSetRule(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCacheNodesOperationsListByIspCustomerResourceSample.js b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCacheNodesOperationsListByIspCustomerResourceSample.js new file mode 100644 index 00000000000..940d5cd7819 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCacheNodesOperationsListByIspCustomerResourceSample.js @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ConnectedCacheClient } = require("@azure/arm-connectedcache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to this api retrieves information about all ispCacheNode resources under the given subscription and resource group + * + * @summary this api retrieves information about all ispCacheNode resources under the given subscription and resource group + * x-ms-original-file: 2023-05-01-preview/IspCacheNodesOperations_ListByIspCustomerResource_MaximumSet_Gen.json + */ +async function ispCacheNodesOperationsListByIspCustomerResource() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.ispCacheNodesOperations.listByIspCustomerResource( + "rgConnectedCache", + "MccRPTest1", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + ispCacheNodesOperationsListByIspCustomerResource(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCacheNodesOperationsUpdateSample.js b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCacheNodesOperationsUpdateSample.js new file mode 100644 index 00000000000..6820e59557e --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCacheNodesOperationsUpdateSample.js @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ConnectedCacheClient } = require("@azure/arm-connectedcache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to this api updates an existing ispCacheNode resource + * + * @summary this api updates an existing ispCacheNode resource + * x-ms-original-file: 2023-05-01-preview/IspCacheNodesOperations_Update_MaximumSet_Gen.json + */ +async function ispCacheNodesOperationsUpdate() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const result = await client.ispCacheNodesOperations.update( + "rgConnectedCache", + "MccRPTest1", + "MCCCachenode1", + { tags: { key1653: "nzjczrhclhkndesgy" } }, + ); + console.log(result); +} + +async function main() { + ispCacheNodesOperationsUpdate(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCustomersCreateOrUpdateSample.js b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCustomersCreateOrUpdateSample.js new file mode 100644 index 00000000000..df37e4cf23a --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCustomersCreateOrUpdateSample.js @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ConnectedCacheClient } = require("@azure/arm-connectedcache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to this api creates an ispCustomer with the specified create parameters + * + * @summary this api creates an ispCustomer with the specified create parameters + * x-ms-original-file: 2023-05-01-preview/IspCustomers_CreateOrUpdate_MaximumSet_Gen.json + */ +async function ispCustomerCreateOrUpdateGeneratedByMaximumSetRule() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const result = await client.ispCustomers.createOrUpdate("rgConnectedCache", "MccRPTest2", { + location: "westus", + properties: { + customer: { + fullyQualifiedResourceId: "uqsbtgae", + customerName: "mkpzynfqihnjfdbaqbqwyhd", + contactEmail: "xquos", + contactPhone: "vue", + contactName: "wxyqjoyoscmvimgwhpitxky", + isEntitled: true, + releaseVersion: 20, + clientTenantId: "fproidkpgvpdnac", + isEnterpriseManaged: true, + shouldMigrate: true, + resendSignupCode: true, + verifySignupCode: true, + verifySignupPhrase: "tprjvttkgmrqlsyicnidhm", + }, + additionalCustomerProperties: { + customerEmail: "zdjgibsidydyzm", + customerTransitAsn: "habgklnxqzmozqpazoyejwiphezpi", + customerAsn: "hgrelgnrtdkleisnepfolu", + customerEntitlementSkuId: "b", + customerEntitlementSkuGuid: "rvzmdpxyflgqetvpwupnfaxsweiiz", + customerEntitlementSkuName: "waaqfijr", + customerEntitlementExpiration: new Date("2024-01-30T00:54:04.773Z"), + optionalProperty1: "qhmwxza", + optionalProperty2: "l", + optionalProperty3: "mblwwvbie", + optionalProperty4: "vzuek", + optionalProperty5: "fzjodscdfcdr", + }, + error: {}, + }, + tags: { key1878: "warz" }, + }); + console.log(result); +} + +async function main() { + ispCustomerCreateOrUpdateGeneratedByMaximumSetRule(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCustomersDeleteSample.js b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCustomersDeleteSample.js new file mode 100644 index 00000000000..53576d37528 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCustomersDeleteSample.js @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ConnectedCacheClient } = require("@azure/arm-connectedcache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to this api deletes an existing ispCustomer resource + * + * @summary this api deletes an existing ispCustomer resource + * x-ms-original-file: 2023-05-01-preview/IspCustomers_Delete_MaximumSet_Gen.json + */ +async function ispCustomersDeleteGeneratedByMaximumSetRule() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + await client.ispCustomers.delete( + "rgConnectedCache", + "hdontfoythjsaeyjhrakckgimgchxwzttbcnvntpvdsgeumxpgnjurptd", + ); +} + +async function main() { + ispCustomersDeleteGeneratedByMaximumSetRule(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCustomersGetSample.js b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCustomersGetSample.js new file mode 100644 index 00000000000..932606d69d8 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCustomersGetSample.js @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ConnectedCacheClient } = require("@azure/arm-connectedcache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to gets the ispCustomer resource information using this get call + * + * @summary gets the ispCustomer resource information using this get call + * x-ms-original-file: 2023-05-01-preview/IspCustomers_Get_MaximumSet_Gen.json + */ +async function ispCustomersGetGeneratedByMaximumSetRule() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const result = await client.ispCustomers.get("rgConnectedCache", "cmcjfueweicolcjkwmsuvcj"); + console.log(result); +} + +async function main() { + ispCustomersGetGeneratedByMaximumSetRule(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCustomersListByResourceGroupSample.js b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCustomersListByResourceGroupSample.js new file mode 100644 index 00000000000..6be72f481df --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCustomersListByResourceGroupSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ConnectedCacheClient } = require("@azure/arm-connectedcache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to this api gets the information about all ispCustomer resources under the given subscription and resource group + * + * @summary this api gets the information about all ispCustomer resources under the given subscription and resource group + * x-ms-original-file: 2023-05-01-preview/IspCustomers_ListByResourceGroup_MaximumSet_Gen.json + */ +async function ispCustomersResourceListByResourceGroupGeneratedByMaximumSetRule() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.ispCustomers.listByResourceGroup("rgConnectedCache")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + ispCustomersResourceListByResourceGroupGeneratedByMaximumSetRule(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCustomersListBySubscriptionSample.js b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCustomersListBySubscriptionSample.js new file mode 100644 index 00000000000..82a4e137e75 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCustomersListBySubscriptionSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ConnectedCacheClient } = require("@azure/arm-connectedcache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to this api gets information about all ispCustomer resources under the given subscription + * + * @summary this api gets information about all ispCustomer resources under the given subscription + * x-ms-original-file: 2023-05-01-preview/IspCustomers_ListBySubscription_MaximumSet_Gen.json + */ +async function ispCustomerListBySubscriptionGeneratedByMaximumSetRule() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.ispCustomers.listBySubscription()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + ispCustomerListBySubscriptionGeneratedByMaximumSetRule(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCustomersUpdateSample.js b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCustomersUpdateSample.js new file mode 100644 index 00000000000..508f5dd64b6 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/ispCustomersUpdateSample.js @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ConnectedCacheClient } = require("@azure/arm-connectedcache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to this api updates an existing ispCustomer resource + * + * @summary this api updates an existing ispCustomer resource + * x-ms-original-file: 2023-05-01-preview/IspCustomers_Update_MaximumSet_Gen.json + */ +async function ispCustomerUpdateDetailsGeneratedByMaximumSetRule() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const result = await client.ispCustomers.update("rgConnectedCache", "MccRPTest2", { + tags: { key1653: "nzjczrhclhkndesgy" }, + }); + console.log(result); +} + +async function main() { + ispCustomerUpdateDetailsGeneratedByMaximumSetRule(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/operationsListSample.js b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/operationsListSample.js new file mode 100644 index 00000000000..50ef1b41796 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/operationsListSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ConnectedCacheClient } = require("@azure/arm-connectedcache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to list the operations for the provider + * + * @summary list the operations for the provider + * x-ms-original-file: 2023-05-01-preview/Operations_List_MaximumSet_Gen.json + */ +async function listTheOperationsForTheProviderGeneratedByMaximumSetRule() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.operations.list()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + listTheOperationsForTheProviderGeneratedByMaximumSetRule(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/package.json b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/package.json new file mode 100644 index 00000000000..df7403e2f7a --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/package.json @@ -0,0 +1,33 @@ +{ + "name": "@azure-samples/arm-connectedcache-js-beta", + "private": true, + "version": "1.0.0", + "description": "@azure/arm-connectedcache client library samples for JavaScript (Beta)", + "engines": { + "node": ">=18.0.0" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Azure/azure-sdk-for-js.git", + "directory": "sdk/connectedcache/arm-connectedcache" + }, + "keywords": [ + "node", + "azure", + "cloud", + "typescript", + "browser", + "isomorphic" + ], + "author": "Microsoft Corporation", + "license": "MIT", + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/connectedcache/arm-connectedcache", + "dependencies": { + "@azure/arm-connectedcache": "next", + "dotenv": "latest", + "@azure/identity": "^4.2.1" + } +} diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/sample.env b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/sample.env new file mode 100644 index 00000000000..508439fc7d6 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/javascript/sample.env @@ -0,0 +1 @@ +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/README.md b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/README.md new file mode 100644 index 00000000000..5ee7096f0f8 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/README.md @@ -0,0 +1,137 @@ +# @azure/arm-connectedcache client library samples for TypeScript (Beta) + +These sample programs show how to use the TypeScript client libraries for @azure/arm-connectedcache in some common scenarios. + +| **File Name** | **Description** | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| [cacheNodesOperationsCreateorUpdateSample.ts][cachenodesoperationscreateorupdatesample] | creates a cacheNodes with the specified create parameters x-ms-original-file: 2023-05-01-preview/CacheNodesOperations_CreateorUpdate_MaximumSet_Gen.json | +| [cacheNodesOperationsDeleteSample.ts][cachenodesoperationsdeletesample] | deletes an existing cache Node x-ms-original-file: 2023-05-01-preview/CacheNodesOperations_Delete_MaximumSet_Gen.json | +| [cacheNodesOperationsGetSample.ts][cachenodesoperationsgetsample] | retrieves the properties of a cacheNodes x-ms-original-file: 2023-05-01-preview/CacheNodesOperations_Get_MaximumSet_Gen.json | +| [cacheNodesOperationsListByResourceGroupSample.ts][cachenodesoperationslistbyresourcegroupsample] | retrieves the properties of all ConnectedCache x-ms-original-file: 2023-05-01-preview/CacheNodesOperations_ListByResourceGroup_MaximumSet_Gen.json | +| [cacheNodesOperationsListBySubscriptionSample.ts][cachenodesoperationslistbysubscriptionsample] | retrieves the properties of all ConnectedCaches x-ms-original-file: 2023-05-01-preview/CacheNodesOperations_ListBySubscription_MaximumSet_Gen.json | +| [cacheNodesOperationsUpdateSample.ts][cachenodesoperationsupdatesample] | updates an existing Cache Node x-ms-original-file: 2023-05-01-preview/CacheNodesOperations_Update_MaximumSet_Gen.json | +| [enterpriseCustomerOperationsCreateOrUpdateSample.ts][enterprisecustomeroperationscreateorupdatesample] | creates a cacheNodes with the specified create parameters x-ms-original-file: 2023-05-01-preview/EnterpriseCustomerOperations_CreateOrUpdate_MaximumSet_Gen.json | +| [enterpriseCustomerOperationsDeleteSample.ts][enterprisecustomeroperationsdeletesample] | deletes an existing customer Enterprise resource x-ms-original-file: 2023-05-01-preview/EnterpriseCustomerOperations_Delete_MaximumSet_Gen.json | +| [enterpriseCustomerOperationsGetSample.ts][enterprisecustomeroperationsgetsample] | retrieves the properties of a Enterprise customer x-ms-original-file: 2023-05-01-preview/EnterpriseCustomerOperations_Get_MaximumSet_Gen.json | +| [enterpriseCustomerOperationsListByResourceGroupSample.ts][enterprisecustomeroperationslistbyresourcegroupsample] | retrieves the properties of all ConnectedCache enterpriseCustomers x-ms-original-file: 2023-05-01-preview/EnterpriseCustomerOperations_ListByResourceGroup_MaximumSet_Gen.json | +| [enterpriseCustomerOperationsListBySubscriptionSample.ts][enterprisecustomeroperationslistbysubscriptionsample] | retrieves the properties of all ConnectedCaches x-ms-original-file: 2023-05-01-preview/EnterpriseCustomerOperations_ListBySubscription_MaximumSet_Gen.json | +| [enterpriseCustomerOperationsUpdateSample.ts][enterprisecustomeroperationsupdatesample] | updates an existing enterpriseCustomers x-ms-original-file: 2023-05-01-preview/EnterpriseCustomerOperations_Update_MaximumSet_Gen.json | +| [enterpriseMccCacheNodesOperationsCreateOrUpdateSample.ts][enterprisemcccachenodesoperationscreateorupdatesample] | this api creates an ispCacheNode with the specified create parameters x-ms-original-file: 2023-05-01-preview/EnterpriseMccCacheNodesOperations_CreateOrUpdate_MaximumSet_Gen.json | +| [enterpriseMccCacheNodesOperationsDeleteSample.ts][enterprisemcccachenodesoperationsdeletesample] | this api deletes an existing ispCacheNode resource x-ms-original-file: 2023-05-01-preview/EnterpriseMccCacheNodesOperations_Delete_MaximumSet_Gen.json | +| [enterpriseMccCacheNodesOperationsGetCacheNodeInstallDetailsSample.ts][enterprisemcccachenodesoperationsgetcachenodeinstalldetailssample] | this api gets secrets of the ispCacheNode resource install details x-ms-original-file: 2023-05-01-preview/EnterpriseMccCacheNodesOperations_GetCacheNodeInstallDetails_MaximumSet_Gen.json | +| [enterpriseMccCacheNodesOperationsGetSample.ts][enterprisemcccachenodesoperationsgetsample] | this api gets ispCacheNode resource information x-ms-original-file: 2023-05-01-preview/EnterpriseMccCacheNodesOperations_Get_MaximumSet_Gen.json | +| [enterpriseMccCacheNodesOperationsListByEnterpriseMccCustomerResourceSample.ts][enterprisemcccachenodesoperationslistbyenterprisemcccustomerresourcesample] | this api retrieves information about all ispCacheNode resources under the given subscription and resource group x-ms-original-file: 2023-05-01-preview/EnterpriseMccCacheNodesOperations_ListByEnterpriseMccCustomerResource_MaximumSet_Gen.json | +| [enterpriseMccCacheNodesOperationsUpdateSample.ts][enterprisemcccachenodesoperationsupdatesample] | this api updates an existing ispCacheNode resource x-ms-original-file: 2023-05-01-preview/EnterpriseMccCacheNodesOperations_Update_MaximumSet_Gen.json | +| [enterpriseMccCustomersCreateOrUpdateSample.ts][enterprisemcccustomerscreateorupdatesample] | this api creates an enterprise mcc customer with the specified create parameters x-ms-original-file: 2023-05-01-preview/EnterpriseMccCustomers_CreateOrUpdate_MaximumSet_Gen.json | +| [enterpriseMccCustomersDeleteSample.ts][enterprisemcccustomersdeletesample] | this api deletes an existing enterprise mcc customer resource x-ms-original-file: 2023-05-01-preview/EnterpriseMccCustomers_Delete_MaximumSet_Gen.json | +| [enterpriseMccCustomersGetSample.ts][enterprisemcccustomersgetsample] | gets the enterprise mcc customer resource information using this get call x-ms-original-file: 2023-05-01-preview/EnterpriseMccCustomers_Get_MaximumSet_Gen.json | +| [enterpriseMccCustomersListByResourceGroupSample.ts][enterprisemcccustomerslistbyresourcegroupsample] | this api gets the information about all enterprise mcc customer resources under the given subscription and resource group x-ms-original-file: 2023-05-01-preview/EnterpriseMccCustomers_ListByResourceGroup_MaximumSet_Gen.json | +| [enterpriseMccCustomersListBySubscriptionSample.ts][enterprisemcccustomerslistbysubscriptionsample] | this api gets information about all enterpriseMccCustomer resources under the given subscription x-ms-original-file: 2023-05-01-preview/EnterpriseMccCustomers_ListBySubscription_MaximumSet_Gen.json | +| [enterpriseMccCustomersUpdateSample.ts][enterprisemcccustomersupdatesample] | this api updates an existing enterprise mcc customer resource x-ms-original-file: 2023-05-01-preview/EnterpriseMccCustomers_Update_MaximumSet_Gen.json | +| [ispCacheNodesOperationsCreateOrUpdateSample.ts][ispcachenodesoperationscreateorupdatesample] | this api creates an ispCacheNode with the specified create parameters x-ms-original-file: 2023-05-01-preview/IspCacheNodesOperations_CreateOrUpdate_MaximumSet_Gen.json | +| [ispCacheNodesOperationsDeleteSample.ts][ispcachenodesoperationsdeletesample] | this api deletes an existing ispCacheNode resource x-ms-original-file: 2023-05-01-preview/IspCacheNodesOperations_Delete_MaximumSet_Gen.json | +| [ispCacheNodesOperationsGetBgpCidrsSample.ts][ispcachenodesoperationsgetbgpcidrssample] | this api gets ispCacheNode resource information x-ms-original-file: 2023-05-01-preview/IspCacheNodesOperations_GetBgpCidrs_MaximumSet_Gen.json | +| [ispCacheNodesOperationsGetCacheNodeInstallDetailsSample.ts][ispcachenodesoperationsgetcachenodeinstalldetailssample] | this api gets secrets of the ispCacheNode resource install details x-ms-original-file: 2023-05-01-preview/IspCacheNodesOperations_GetCacheNodeInstallDetails_MaximumSet_Gen.json | +| [ispCacheNodesOperationsGetSample.ts][ispcachenodesoperationsgetsample] | this api gets ispCacheNode resource information x-ms-original-file: 2023-05-01-preview/IspCacheNodesOperations_Get_MaximumSet_Gen.json | +| [ispCacheNodesOperationsListByIspCustomerResourceSample.ts][ispcachenodesoperationslistbyispcustomerresourcesample] | this api retrieves information about all ispCacheNode resources under the given subscription and resource group x-ms-original-file: 2023-05-01-preview/IspCacheNodesOperations_ListByIspCustomerResource_MaximumSet_Gen.json | +| [ispCacheNodesOperationsUpdateSample.ts][ispcachenodesoperationsupdatesample] | this api updates an existing ispCacheNode resource x-ms-original-file: 2023-05-01-preview/IspCacheNodesOperations_Update_MaximumSet_Gen.json | +| [ispCustomersCreateOrUpdateSample.ts][ispcustomerscreateorupdatesample] | this api creates an ispCustomer with the specified create parameters x-ms-original-file: 2023-05-01-preview/IspCustomers_CreateOrUpdate_MaximumSet_Gen.json | +| [ispCustomersDeleteSample.ts][ispcustomersdeletesample] | this api deletes an existing ispCustomer resource x-ms-original-file: 2023-05-01-preview/IspCustomers_Delete_MaximumSet_Gen.json | +| [ispCustomersGetSample.ts][ispcustomersgetsample] | gets the ispCustomer resource information using this get call x-ms-original-file: 2023-05-01-preview/IspCustomers_Get_MaximumSet_Gen.json | +| [ispCustomersListByResourceGroupSample.ts][ispcustomerslistbyresourcegroupsample] | this api gets the information about all ispCustomer resources under the given subscription and resource group x-ms-original-file: 2023-05-01-preview/IspCustomers_ListByResourceGroup_MaximumSet_Gen.json | +| [ispCustomersListBySubscriptionSample.ts][ispcustomerslistbysubscriptionsample] | this api gets information about all ispCustomer resources under the given subscription x-ms-original-file: 2023-05-01-preview/IspCustomers_ListBySubscription_MaximumSet_Gen.json | +| [ispCustomersUpdateSample.ts][ispcustomersupdatesample] | this api updates an existing ispCustomer resource x-ms-original-file: 2023-05-01-preview/IspCustomers_Update_MaximumSet_Gen.json | +| [operationsListSample.ts][operationslistsample] | list the operations for the provider x-ms-original-file: 2023-05-01-preview/Operations_List_MaximumSet_Gen.json | + +## Prerequisites + +The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). + +Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using: + +```bash +npm install -g typescript +``` + +You need [an Azure subscription][freesub] to run these sample programs. + +Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. + +Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. + +## Setup + +To run the samples using the published version of the package: + +1. Install the dependencies using `npm`: + +```bash +npm install +``` + +2. Compile the samples: + +```bash +npm run build +``` + +3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. + +4. Run whichever samples you like (note that some samples may require additional setup, see the table above): + +```bash +node dist/cacheNodesOperationsCreateorUpdateSample.js +``` + +Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): + +```bash +npx dev-tool run vendored cross-env node dist/cacheNodesOperationsCreateorUpdateSample.js +``` + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +[cachenodesoperationscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/cacheNodesOperationsCreateorUpdateSample.ts +[cachenodesoperationsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/cacheNodesOperationsDeleteSample.ts +[cachenodesoperationsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/cacheNodesOperationsGetSample.ts +[cachenodesoperationslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/cacheNodesOperationsListByResourceGroupSample.ts +[cachenodesoperationslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/cacheNodesOperationsListBySubscriptionSample.ts +[cachenodesoperationsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/cacheNodesOperationsUpdateSample.ts +[enterprisecustomeroperationscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseCustomerOperationsCreateOrUpdateSample.ts +[enterprisecustomeroperationsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseCustomerOperationsDeleteSample.ts +[enterprisecustomeroperationsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseCustomerOperationsGetSample.ts +[enterprisecustomeroperationslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseCustomerOperationsListByResourceGroupSample.ts +[enterprisecustomeroperationslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseCustomerOperationsListBySubscriptionSample.ts +[enterprisecustomeroperationsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseCustomerOperationsUpdateSample.ts +[enterprisemcccachenodesoperationscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseMccCacheNodesOperationsCreateOrUpdateSample.ts +[enterprisemcccachenodesoperationsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseMccCacheNodesOperationsDeleteSample.ts +[enterprisemcccachenodesoperationsgetcachenodeinstalldetailssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseMccCacheNodesOperationsGetCacheNodeInstallDetailsSample.ts +[enterprisemcccachenodesoperationsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseMccCacheNodesOperationsGetSample.ts +[enterprisemcccachenodesoperationslistbyenterprisemcccustomerresourcesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseMccCacheNodesOperationsListByEnterpriseMccCustomerResourceSample.ts +[enterprisemcccachenodesoperationsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseMccCacheNodesOperationsUpdateSample.ts +[enterprisemcccustomerscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseMccCustomersCreateOrUpdateSample.ts +[enterprisemcccustomersdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseMccCustomersDeleteSample.ts +[enterprisemcccustomersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseMccCustomersGetSample.ts +[enterprisemcccustomerslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseMccCustomersListByResourceGroupSample.ts +[enterprisemcccustomerslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseMccCustomersListBySubscriptionSample.ts +[enterprisemcccustomersupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseMccCustomersUpdateSample.ts +[ispcachenodesoperationscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCacheNodesOperationsCreateOrUpdateSample.ts +[ispcachenodesoperationsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCacheNodesOperationsDeleteSample.ts +[ispcachenodesoperationsgetbgpcidrssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCacheNodesOperationsGetBgpCidrsSample.ts +[ispcachenodesoperationsgetcachenodeinstalldetailssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCacheNodesOperationsGetCacheNodeInstallDetailsSample.ts +[ispcachenodesoperationsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCacheNodesOperationsGetSample.ts +[ispcachenodesoperationslistbyispcustomerresourcesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCacheNodesOperationsListByIspCustomerResourceSample.ts +[ispcachenodesoperationsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCacheNodesOperationsUpdateSample.ts +[ispcustomerscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCustomersCreateOrUpdateSample.ts +[ispcustomersdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCustomersDeleteSample.ts +[ispcustomersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCustomersGetSample.ts +[ispcustomerslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCustomersListByResourceGroupSample.ts +[ispcustomerslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCustomersListBySubscriptionSample.ts +[ispcustomersupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCustomersUpdateSample.ts +[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/operationsListSample.ts +[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-connectedcache?view=azure-node-preview +[freesub]: https://azure.microsoft.com/free/ +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/connectedcache/arm-connectedcache/README.md +[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/package.json b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/package.json new file mode 100644 index 00000000000..057fc03a44a --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/package.json @@ -0,0 +1,42 @@ +{ + "name": "@azure-samples/arm-connectedcache-ts-beta", + "private": true, + "version": "1.0.0", + "description": "@azure/arm-connectedcache client library samples for TypeScript (Beta)", + "engines": { + "node": ">=18.0.0" + }, + "scripts": { + "build": "tsc", + "prebuild": "rimraf dist/" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Azure/azure-sdk-for-js.git", + "directory": "sdk/connectedcache/arm-connectedcache" + }, + "keywords": [ + "node", + "azure", + "cloud", + "typescript", + "browser", + "isomorphic" + ], + "author": "Microsoft Corporation", + "license": "MIT", + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/connectedcache/arm-connectedcache", + "dependencies": { + "@azure/arm-connectedcache": "next", + "dotenv": "latest", + "@azure/identity": "^4.2.1" + }, + "devDependencies": { + "@types/node": "^18.0.0", + "typescript": "~5.6.2", + "rimraf": "latest" + } +} diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/sample.env b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/sample.env new file mode 100644 index 00000000000..508439fc7d6 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/sample.env @@ -0,0 +1 @@ +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/cacheNodesOperationsCreateorUpdateSample.ts b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/cacheNodesOperationsCreateorUpdateSample.ts new file mode 100644 index 00000000000..0d69ddf1e6d --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/cacheNodesOperationsCreateorUpdateSample.ts @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to creates a cacheNodes with the specified create parameters + * + * @summary creates a cacheNodes with the specified create parameters + * x-ms-original-file: 2023-05-01-preview/CacheNodesOperations_CreateorUpdate_MaximumSet_Gen.json + */ +async function cacheNodesOperationsCreateorUpdate() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const result = await client.cacheNodesOperations.createorUpdate( + "rgConnectedCache", + "lwrsyhvfpcfrwrim", + { + location: "westus", + properties: { + statusCode: "movtzupooyhdqk", + statusText: "bjnsrpzaofjntleoesjwammgbi", + statusDetails: "quuziibkwtgf", + error: {}, + }, + tags: { key8256: "oreqiywrjkmate" }, + }, + ); + console.log(result); +} + +async function main() { + cacheNodesOperationsCreateorUpdate(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/cacheNodesOperationsDeleteSample.ts b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/cacheNodesOperationsDeleteSample.ts new file mode 100644 index 00000000000..d2ff8223234 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/cacheNodesOperationsDeleteSample.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to deletes an existing cache Node + * + * @summary deletes an existing cache Node + * x-ms-original-file: 2023-05-01-preview/CacheNodesOperations_Delete_MaximumSet_Gen.json + */ +async function cacheNodesOperationsDelete() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + await client.cacheNodesOperations.delete( + "rgConnectedCache", + "otvtvhmovthjwzjzbsqkbnmpcmmeianpqxmmaspvdczmrenquxigrtuarmlcmvsnaclhcbw", + ); +} + +async function main() { + cacheNodesOperationsDelete(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/cacheNodesOperationsGetSample.ts b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/cacheNodesOperationsGetSample.ts new file mode 100644 index 00000000000..4a7fadc930d --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/cacheNodesOperationsGetSample.ts @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to retrieves the properties of a cacheNodes + * + * @summary retrieves the properties of a cacheNodes + * x-ms-original-file: 2023-05-01-preview/CacheNodesOperations_Get_MaximumSet_Gen.json + */ +async function cacheNodesOperationsGet() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const result = await client.cacheNodesOperations.get( + "rgConnectedCache", + "nqoxkgorhuzbhjwcegymzqbeydzjupemekt", + ); + console.log(result); +} + +async function main() { + cacheNodesOperationsGet(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/cacheNodesOperationsListByResourceGroupSample.ts b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/cacheNodesOperationsListByResourceGroupSample.ts new file mode 100644 index 00000000000..294629a3fd9 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/cacheNodesOperationsListByResourceGroupSample.ts @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to retrieves the properties of all ConnectedCache + * + * @summary retrieves the properties of all ConnectedCache + * x-ms-original-file: 2023-05-01-preview/CacheNodesOperations_ListByResourceGroup_MaximumSet_Gen.json + */ +async function cacheNodesPrivatePreviewLegacyGetOperationListByResourceGroupGeneratedByMaximumSetRule() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.cacheNodesOperations.listByResourceGroup( + "rgConnectedCache", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + cacheNodesPrivatePreviewLegacyGetOperationListByResourceGroupGeneratedByMaximumSetRule(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/cacheNodesOperationsListBySubscriptionSample.ts b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/cacheNodesOperationsListBySubscriptionSample.ts new file mode 100644 index 00000000000..b757e797b1b --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/cacheNodesOperationsListBySubscriptionSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to retrieves the properties of all ConnectedCaches + * + * @summary retrieves the properties of all ConnectedCaches + * x-ms-original-file: 2023-05-01-preview/CacheNodesOperations_ListBySubscription_MaximumSet_Gen.json + */ +async function cacheNodesPrivatePreviewLegacyResourceListBySubscriptionGeneratedByMaximumSetRule() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.cacheNodesOperations.listBySubscription()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + cacheNodesPrivatePreviewLegacyResourceListBySubscriptionGeneratedByMaximumSetRule(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/cacheNodesOperationsUpdateSample.ts b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/cacheNodesOperationsUpdateSample.ts new file mode 100644 index 00000000000..b6ccee08f0c --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/cacheNodesOperationsUpdateSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to updates an existing Cache Node + * + * @summary updates an existing Cache Node + * x-ms-original-file: 2023-05-01-preview/CacheNodesOperations_Update_MaximumSet_Gen.json + */ +async function cacheNodesPrivatePreviewLegacyUpdateOperationGeneratedByMaximumSetRule() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const result = await client.cacheNodesOperations.update( + "rgConnectedCache", + "wlrwpdbcv", + { tags: { key5032: "esiuyjbpcwkpqriqiqztxuocv" } }, + ); + console.log(result); +} + +async function main() { + cacheNodesPrivatePreviewLegacyUpdateOperationGeneratedByMaximumSetRule(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseCustomerOperationsCreateOrUpdateSample.ts b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseCustomerOperationsCreateOrUpdateSample.ts new file mode 100644 index 00000000000..196c7afea1c --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseCustomerOperationsCreateOrUpdateSample.ts @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to creates a cacheNodes with the specified create parameters + * + * @summary creates a cacheNodes with the specified create parameters + * x-ms-original-file: 2023-05-01-preview/EnterpriseCustomerOperations_CreateOrUpdate_MaximumSet_Gen.json + */ +async function enterpriseCustomerOperationsCreateOrUpdate() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const result = await client.enterpriseCustomerOperations.createOrUpdate( + "rgConnectedCache", + "l", + { + properties: { + statusCode: "oldkroffqtkryqffpsi", + statusText: "bs", + statusDetails: "lhwvcz", + error: {}, + }, + tags: { key4215: "zjbszvlzf" }, + location: "zdzhhkjyogrqxwihkifnmeyhwpujbr", + }, + ); + console.log(result); +} + +async function main() { + enterpriseCustomerOperationsCreateOrUpdate(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseCustomerOperationsDeleteSample.ts b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseCustomerOperationsDeleteSample.ts new file mode 100644 index 00000000000..038a8a9d100 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseCustomerOperationsDeleteSample.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to deletes an existing customer Enterprise resource + * + * @summary deletes an existing customer Enterprise resource + * x-ms-original-file: 2023-05-01-preview/EnterpriseCustomerOperations_Delete_MaximumSet_Gen.json + */ +async function enterpriseCustomerOperationsDelete() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + await client.enterpriseCustomerOperations.delete( + "rgConnectedCache", + "jeubxmhiaihcusgnahblvvckbdcetacvqgwbohlrqucodtlwuyefpejskvamgrdnwgucziodcfpjhqy", + ); +} + +async function main() { + enterpriseCustomerOperationsDelete(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseCustomerOperationsGetSample.ts b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseCustomerOperationsGetSample.ts new file mode 100644 index 00000000000..b32f021b13a --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseCustomerOperationsGetSample.ts @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to retrieves the properties of a Enterprise customer + * + * @summary retrieves the properties of a Enterprise customer + * x-ms-original-file: 2023-05-01-preview/EnterpriseCustomerOperations_Get_MaximumSet_Gen.json + */ +async function enterpriseCustomerOperationsGet() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const result = await client.enterpriseCustomerOperations.get( + "rgConnectedCache", + "MCCTPTest2", + ); + console.log(result); +} + +async function main() { + enterpriseCustomerOperationsGet(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseCustomerOperationsListByResourceGroupSample.ts b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseCustomerOperationsListByResourceGroupSample.ts new file mode 100644 index 00000000000..8752130d420 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseCustomerOperationsListByResourceGroupSample.ts @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to retrieves the properties of all ConnectedCache enterpriseCustomers + * + * @summary retrieves the properties of all ConnectedCache enterpriseCustomers + * x-ms-original-file: 2023-05-01-preview/EnterpriseCustomerOperations_ListByResourceGroup_MaximumSet_Gen.json + */ +async function enterpriseCustomerOperationsListByResourceGroup() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.enterpriseCustomerOperations.listByResourceGroup( + "rgConnectedCache", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + enterpriseCustomerOperationsListByResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseCustomerOperationsListBySubscriptionSample.ts b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseCustomerOperationsListBySubscriptionSample.ts new file mode 100644 index 00000000000..a0372d2f38b --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseCustomerOperationsListBySubscriptionSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to retrieves the properties of all ConnectedCaches + * + * @summary retrieves the properties of all ConnectedCaches + * x-ms-original-file: 2023-05-01-preview/EnterpriseCustomerOperations_ListBySubscription_MaximumSet_Gen.json + */ +async function enterpriseCustomerOperationsListBySubscription() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.enterpriseCustomerOperations.listBySubscription()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + enterpriseCustomerOperationsListBySubscription(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseCustomerOperationsUpdateSample.ts b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseCustomerOperationsUpdateSample.ts new file mode 100644 index 00000000000..25168f64f83 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseCustomerOperationsUpdateSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to updates an existing enterpriseCustomers + * + * @summary updates an existing enterpriseCustomers + * x-ms-original-file: 2023-05-01-preview/EnterpriseCustomerOperations_Update_MaximumSet_Gen.json + */ +async function enterpriseCustomerOperationsUpdate() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const result = await client.enterpriseCustomerOperations.update( + "rgConnectedCache", + "MCCTPTest2", + { tags: { key1653: "nzjczrhclhkndesgy" } }, + ); + console.log(result); +} + +async function main() { + enterpriseCustomerOperationsUpdate(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseMccCacheNodesOperationsCreateOrUpdateSample.ts b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseMccCacheNodesOperationsCreateOrUpdateSample.ts new file mode 100644 index 00000000000..9de31869c9b --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseMccCacheNodesOperationsCreateOrUpdateSample.ts @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to this api creates an ispCacheNode with the specified create parameters + * + * @summary this api creates an ispCacheNode with the specified create parameters + * x-ms-original-file: 2023-05-01-preview/EnterpriseMccCacheNodesOperations_CreateOrUpdate_MaximumSet_Gen.json + */ +async function createsAnEnterpriseMccCacheNodeResourceGeneratedByMaximumSetRule() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const result = await client.enterpriseMccCacheNodesOperations.createOrUpdate( + "rgConnectedCache", + "nhdkvstdrrtsxxuz", + "fgduqdovidpemlnmhelomffuafdrbgaasqznvrdkbvspfzsnrhncdtqquhijhdpwyzwleukqldpceyxqhqlftqrr", + { + location: "westus", + properties: { + cacheNode: { + fullyQualifiedResourceId: "yeinlleavzbehelhsucb", + customerName: "zsklcocjfjhkcpmzyefzkwamdzc", + ipAddress: "gbfkdhloyphnpnhemwrcrxlk", + customerIndex: "vafvezmelfgmjsrccjukrhppljvipg", + cacheNodeId: "fmrjefyddfn", + cacheNodeName: "qppvqxliajjfoalzjbgmxggr", + customerAsn: 25, + isEnabled: true, + maxAllowableEgressInMbps: 27, + isEnterpriseManaged: true, + cidrCsv: ["nlqlvrthafvvljuupcbcw"], + shouldMigrate: true, + cidrSelectionType: 11, + }, + statusCode: "1", + statusText: "Success", + statusDetails: "lgljxmyyoakw", + additionalCacheNodeProperties: { + cacheNodePropertiesDetailsIssuesList: [ + "ennbzfpuszgalzpawmwicaofqcwcj", + ], + driveConfiguration: [ + { + physicalPath: "pcbkezoofhamkycot", + sizeInGb: 14, + cacheNumber: 11, + nginxMapping: "cirlpkpuxg", + }, + ], + bgpConfiguration: { asnToIpAddressMapping: "fjbggfvumrn" }, + proxyUrlConfiguration: { proxyUrl: "hplstyg" }, + proxyUrl: "ihkzxlzvpcywtzrogupqozkdud", + optionalProperty1: "ph", + optionalProperty2: "soqqgpgcbhb", + optionalProperty3: "fpnycrbagptsujiotnjfuhlm", + optionalProperty4: "gesqugrxvhxlxxyvatgrautxwlmxsf", + optionalProperty5: "zknjgzpaqtvdqjydd", + }, + error: {}, + }, + tags: { key259: "qbkixjuyjkoj" }, + }, + ); + console.log(result); +} + +async function main() { + createsAnEnterpriseMccCacheNodeResourceGeneratedByMaximumSetRule(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseMccCacheNodesOperationsDeleteSample.ts b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseMccCacheNodesOperationsDeleteSample.ts new file mode 100644 index 00000000000..6194639f739 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseMccCacheNodesOperationsDeleteSample.ts @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to this api deletes an existing ispCacheNode resource + * + * @summary this api deletes an existing ispCacheNode resource + * x-ms-original-file: 2023-05-01-preview/EnterpriseMccCacheNodesOperations_Delete_MaximumSet_Gen.json + */ +async function enterpriseMccCacheNodesOperationsDeleteOperationGeneratedByMaximumSetRule() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + await client.enterpriseMccCacheNodesOperations.delete( + "rgConnectedCache", + "hsincngmssuzeyispnufqwinpopadvhsbsemisguxgovwdjwviqexocelijvuyr", + "vwtrhdoxvkrunpliwcao", + ); +} + +async function main() { + enterpriseMccCacheNodesOperationsDeleteOperationGeneratedByMaximumSetRule(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseMccCacheNodesOperationsGetCacheNodeInstallDetailsSample.ts b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseMccCacheNodesOperationsGetCacheNodeInstallDetailsSample.ts new file mode 100644 index 00000000000..508d2912b92 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseMccCacheNodesOperationsGetCacheNodeInstallDetailsSample.ts @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to this api gets secrets of the ispCacheNode resource install details + * + * @summary this api gets secrets of the ispCacheNode resource install details + * x-ms-original-file: 2023-05-01-preview/EnterpriseMccCacheNodesOperations_GetCacheNodeInstallDetails_MaximumSet_Gen.json + */ +async function getsRequiredPropertiesForEnterpriseMccCacheNodeResourceInstallKeyDetailsGeneratedByMaximumSetRule() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const result = + await client.enterpriseMccCacheNodesOperations.getCacheNodeInstallDetails( + "rgConnectedCache", + "fzwxcjmdpxxzayecabqqlh", + "ccexmqqttritxvtctivraso", + ); + console.log(result); +} + +async function main() { + getsRequiredPropertiesForEnterpriseMccCacheNodeResourceInstallKeyDetailsGeneratedByMaximumSetRule(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseMccCacheNodesOperationsGetSample.ts b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseMccCacheNodesOperationsGetSample.ts new file mode 100644 index 00000000000..d509e82a96c --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseMccCacheNodesOperationsGetSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to this api gets ispCacheNode resource information + * + * @summary this api gets ispCacheNode resource information + * x-ms-original-file: 2023-05-01-preview/EnterpriseMccCacheNodesOperations_Get_MaximumSet_Gen.json + */ +async function getsEnterpriseMccCacheNodeResourceInformationOfAnEnterpriseMccCustomerParentResourceGeneratedByMaximumSetRule() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const result = await client.enterpriseMccCacheNodesOperations.get( + "rgConnectedCache", + "cygqjgtcetihsajgyqwwrbclssqsvhgltrboemcqqtpoxdbhykqxblaihmrumyhbsx", + "fqxfadsultwjfzdwlqkvneakfsbyhratytmssmiukpbnus", + ); + console.log(result); +} + +async function main() { + getsEnterpriseMccCacheNodeResourceInformationOfAnEnterpriseMccCustomerParentResourceGeneratedByMaximumSetRule(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseMccCacheNodesOperationsListByEnterpriseMccCustomerResourceSample.ts b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseMccCacheNodesOperationsListByEnterpriseMccCustomerResourceSample.ts new file mode 100644 index 00000000000..8b1f20e3814 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseMccCacheNodesOperationsListByEnterpriseMccCustomerResourceSample.ts @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to this api retrieves information about all ispCacheNode resources under the given subscription and resource group + * + * @summary this api retrieves information about all ispCacheNode resources under the given subscription and resource group + * x-ms-original-file: 2023-05-01-preview/EnterpriseMccCacheNodesOperations_ListByEnterpriseMccCustomerResource_MaximumSet_Gen.json + */ +async function enterpriseMccCacheNodesOperationsListByEnterpriseMccCustomerResource() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.enterpriseMccCacheNodesOperations.listByEnterpriseMccCustomerResource( + "rgConnectedCache", + "syjjjzk", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + enterpriseMccCacheNodesOperationsListByEnterpriseMccCustomerResource(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseMccCacheNodesOperationsUpdateSample.ts b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseMccCacheNodesOperationsUpdateSample.ts new file mode 100644 index 00000000000..5b6f134134b --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseMccCacheNodesOperationsUpdateSample.ts @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to this api updates an existing ispCacheNode resource + * + * @summary this api updates an existing ispCacheNode resource + * x-ms-original-file: 2023-05-01-preview/EnterpriseMccCacheNodesOperations_Update_MaximumSet_Gen.json + */ +async function enterpriseMccCacheNodesOperationsUpdateGeneratedByMaximumSetRule() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const result = await client.enterpriseMccCacheNodesOperations.update( + "rgConnectedCache", + "qanjqtvrxzjkljdysdjvdiqcxkttskpdzykzuefhbhz", + "kllmlvazrcxmfjfozulzqnsgvspgwmhogcafvauchunlgfr", + { tags: { key1653: "nzjczrhclhkndesgy" } }, + ); + console.log(result); +} + +async function main() { + enterpriseMccCacheNodesOperationsUpdateGeneratedByMaximumSetRule(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseMccCustomersCreateOrUpdateSample.ts b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseMccCustomersCreateOrUpdateSample.ts new file mode 100644 index 00000000000..1ff4fdeb44b --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseMccCustomersCreateOrUpdateSample.ts @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to this api creates an enterprise mcc customer with the specified create parameters + * + * @summary this api creates an enterprise mcc customer with the specified create parameters + * x-ms-original-file: 2023-05-01-preview/EnterpriseMccCustomers_CreateOrUpdate_MaximumSet_Gen.json + */ +async function enterpriseMccCustomersCreateOrUpdate() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const result = await client.enterpriseMccCustomers.createOrUpdate( + "rgConnectedCache", + "MccRPTest1", + { + properties: { + customer: { + fullyQualifiedResourceId: "uqsbtgae", + customerName: "mkpzynfqihnjfdbaqbqwyhd", + contactEmail: "xquos", + contactPhone: "vue", + contactName: "wxyqjoyoscmvimgwhpitxky", + isEntitled: true, + releaseVersion: 20, + clientTenantId: "fproidkpgvpdnac", + isEnterpriseManaged: true, + shouldMigrate: true, + resendSignupCode: true, + verifySignupCode: true, + verifySignupPhrase: "tprjvttkgmrqlsyicnidhm", + }, + additionalCustomerProperties: { + customerEmail: "zdjgibsidydyzm", + customerTransitAsn: "habgklnxqzmozqpazoyejwiphezpi", + customerAsn: "hgrelgnrtdkleisnepfolu", + customerEntitlementSkuId: "b", + customerEntitlementSkuGuid: "rvzmdpxyflgqetvpwupnfaxsweiiz", + customerEntitlementSkuName: "waaqfijr", + customerEntitlementExpiration: new Date("2024-01-30T00:54:04.773Z"), + optionalProperty1: "qhmwxza", + optionalProperty2: "l", + optionalProperty3: "mblwwvbie", + optionalProperty4: "vzuek", + optionalProperty5: "fzjodscdfcdr", + }, + error: {}, + }, + tags: { key3379: "dpyqeaqhcnutzezom" }, + location: "westus", + }, + ); + console.log(result); +} + +async function main() { + enterpriseMccCustomersCreateOrUpdate(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseMccCustomersDeleteSample.ts b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseMccCustomersDeleteSample.ts new file mode 100644 index 00000000000..727b6f7f340 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseMccCustomersDeleteSample.ts @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to this api deletes an existing enterprise mcc customer resource + * + * @summary this api deletes an existing enterprise mcc customer resource + * x-ms-original-file: 2023-05-01-preview/EnterpriseMccCustomers_Delete_MaximumSet_Gen.json + */ +async function enterpriseMccCustomersDelete() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + await client.enterpriseMccCustomers.delete("rgConnectedCache", "zktb"); +} + +async function main() { + enterpriseMccCustomersDelete(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseMccCustomersGetSample.ts b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseMccCustomersGetSample.ts new file mode 100644 index 00000000000..007b07ef071 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseMccCustomersGetSample.ts @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets the enterprise mcc customer resource information using this get call + * + * @summary gets the enterprise mcc customer resource information using this get call + * x-ms-original-file: 2023-05-01-preview/EnterpriseMccCustomers_Get_MaximumSet_Gen.json + */ +async function enterpriseMccCustomersGet() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const result = await client.enterpriseMccCustomers.get( + "rgConnectedCache", + "pvilvqkofbjbykupeewgvzlmjao", + ); + console.log(result); +} + +async function main() { + enterpriseMccCustomersGet(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseMccCustomersListByResourceGroupSample.ts b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseMccCustomersListByResourceGroupSample.ts new file mode 100644 index 00000000000..b9aae22f0ae --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseMccCustomersListByResourceGroupSample.ts @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to this api gets the information about all enterprise mcc customer resources under the given subscription and resource group + * + * @summary this api gets the information about all enterprise mcc customer resources under the given subscription and resource group + * x-ms-original-file: 2023-05-01-preview/EnterpriseMccCustomers_ListByResourceGroup_MaximumSet_Gen.json + */ +async function enterpriseMccCustomersListByResourceGroup() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.enterpriseMccCustomers.listByResourceGroup( + "rgConnectedCache", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + enterpriseMccCustomersListByResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseMccCustomersListBySubscriptionSample.ts b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseMccCustomersListBySubscriptionSample.ts new file mode 100644 index 00000000000..4ea2b46dd19 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseMccCustomersListBySubscriptionSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to this api gets information about all enterpriseMccCustomer resources under the given subscription + * + * @summary this api gets information about all enterpriseMccCustomer resources under the given subscription + * x-ms-original-file: 2023-05-01-preview/EnterpriseMccCustomers_ListBySubscription_MaximumSet_Gen.json + */ +async function enterpriseMccCustomersListBySubscription() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.enterpriseMccCustomers.listBySubscription()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + enterpriseMccCustomersListBySubscription(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseMccCustomersUpdateSample.ts b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseMccCustomersUpdateSample.ts new file mode 100644 index 00000000000..44d6975caad --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/enterpriseMccCustomersUpdateSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to this api updates an existing enterprise mcc customer resource + * + * @summary this api updates an existing enterprise mcc customer resource + * x-ms-original-file: 2023-05-01-preview/EnterpriseMccCustomers_Update_MaximumSet_Gen.json + */ +async function enterpriseMccCustomersUpdate() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const result = await client.enterpriseMccCustomers.update( + "rgConnectedCache", + "MccRPTest1", + { tags: { key1878: "warz" } }, + ); + console.log(result); +} + +async function main() { + enterpriseMccCustomersUpdate(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCacheNodesOperationsCreateOrUpdateSample.ts b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCacheNodesOperationsCreateOrUpdateSample.ts new file mode 100644 index 00000000000..284bd0f4f6a --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCacheNodesOperationsCreateOrUpdateSample.ts @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to this api creates an ispCacheNode with the specified create parameters + * + * @summary this api creates an ispCacheNode with the specified create parameters + * x-ms-original-file: 2023-05-01-preview/IspCacheNodesOperations_CreateOrUpdate_MaximumSet_Gen.json + */ +async function ispCacheNodesOperationsCreateOrUpdate() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const result = await client.ispCacheNodesOperations.createOrUpdate( + "rgConnectedCache", + "zpqzbmanlljgmkrthtydrtneavhlnlqkdmviq", + "cabakm", + { + location: "westus", + properties: { + cacheNode: { + fullyQualifiedResourceId: "hskxkpbiqbrbjiwdzrxndru", + customerName: "xwyqk", + ipAddress: "voctagljcwqgcpnionqdcbjk", + customerIndex: "qtoiglqaswivmkjhzogburcxtszmek", + cacheNodeId: "xjzffjftwcgsehanoxsl", + cacheNodeName: "mfjxb", + customerAsn: 4, + isEnabled: true, + maxAllowableEgressInMbps: 29, + isEnterpriseManaged: true, + cidrCsv: ["nlqlvrthafvvljuupcbcw"], + shouldMigrate: true, + cidrSelectionType: 4, + }, + additionalCacheNodeProperties: { + driveConfiguration: [ + { + physicalPath: "/mcc", + sizeInGb: 500, + cacheNumber: 1, + nginxMapping: "lijygenjq", + }, + ], + bgpConfiguration: { asnToIpAddressMapping: "pafcimhoog" }, + cacheNodePropertiesDetailsIssuesList: ["ex"], + proxyUrlConfiguration: { proxyUrl: "hplstyg" }, + proxyUrl: "qhux", + optionalProperty1: "hvpmt", + optionalProperty2: "talanelmsgxvksrzoeeontqkjzbpv", + optionalProperty3: "bxkoxq", + optionalProperty4: "pqlkcekupusoc", + optionalProperty5: "nyvvmrjigqdufzjdvazdca", + }, + statusCode: "1", + statusText: "Success", + statusDetails: "djruqvptzxak", + error: {}, + }, + tags: { key4171: "qtjlszkawsdujzpgohsbw" }, + }, + ); + console.log(result); +} + +async function main() { + ispCacheNodesOperationsCreateOrUpdate(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCacheNodesOperationsDeleteSample.ts b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCacheNodesOperationsDeleteSample.ts new file mode 100644 index 00000000000..9d5f41ab077 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCacheNodesOperationsDeleteSample.ts @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to this api deletes an existing ispCacheNode resource + * + * @summary this api deletes an existing ispCacheNode resource + * x-ms-original-file: 2023-05-01-preview/IspCacheNodesOperations_Delete_MaximumSet_Gen.json + */ +async function ispCacheNodesDeleteOperationGeneratedByMaximumSetRule() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + await client.ispCacheNodesOperations.delete( + "rgConnectedCache", + "lvpcosvbfxtpzscakewx", + "wsiruvexelltpbouqxvsogqpxdizcwqwfowybncvjunlakjwcpgmqbdbgzjrsmxlkczxnsxfonhnqqa", + ); +} + +async function main() { + ispCacheNodesDeleteOperationGeneratedByMaximumSetRule(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCacheNodesOperationsGetBgpCidrsSample.ts b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCacheNodesOperationsGetBgpCidrsSample.ts new file mode 100644 index 00000000000..abcb0e45e09 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCacheNodesOperationsGetBgpCidrsSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to this api gets ispCacheNode resource information + * + * @summary this api gets ispCacheNode resource information + * x-ms-original-file: 2023-05-01-preview/IspCacheNodesOperations_GetBgpCidrs_MaximumSet_Gen.json + */ +async function ispCacheNodesResourceBgpCidrsDetailsGeneratedByMaximumSetRule() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const result = await client.ispCacheNodesOperations.getBgpCidrs( + "rgConnectedCache", + "MccRPTest1", + "MCCCachenode1", + ); + console.log(result); +} + +async function main() { + ispCacheNodesResourceBgpCidrsDetailsGeneratedByMaximumSetRule(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCacheNodesOperationsGetCacheNodeInstallDetailsSample.ts b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCacheNodesOperationsGetCacheNodeInstallDetailsSample.ts new file mode 100644 index 00000000000..6558d4ff4c3 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCacheNodesOperationsGetCacheNodeInstallDetailsSample.ts @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to this api gets secrets of the ispCacheNode resource install details + * + * @summary this api gets secrets of the ispCacheNode resource install details + * x-ms-original-file: 2023-05-01-preview/IspCacheNodesOperations_GetCacheNodeInstallDetails_MaximumSet_Gen.json + */ +async function ispCacheNodeResourceGetInstallDetailsGeneratedByMaximumSetRule() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const result = + await client.ispCacheNodesOperations.getCacheNodeInstallDetails( + "rgConnectedCache", + "MccRPTest1", + "MCCCachenode1", + ); + console.log(result); +} + +async function main() { + ispCacheNodeResourceGetInstallDetailsGeneratedByMaximumSetRule(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCacheNodesOperationsGetSample.ts b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCacheNodesOperationsGetSample.ts new file mode 100644 index 00000000000..648edef4c39 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCacheNodesOperationsGetSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to this api gets ispCacheNode resource information + * + * @summary this api gets ispCacheNode resource information + * x-ms-original-file: 2023-05-01-preview/IspCacheNodesOperations_Get_MaximumSet_Gen.json + */ +async function ispCacheNodesGetResourceGeneratedByMaximumSetRule() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const result = await client.ispCacheNodesOperations.get( + "rgConnectedCache", + "sgtqjsitdrskmgyrrkntszwrrjjkretscpjgaezraucvcwececlelcsorfunrnvxyxcsrg", + "lbsziwmudcjnwnwy", + ); + console.log(result); +} + +async function main() { + ispCacheNodesGetResourceGeneratedByMaximumSetRule(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCacheNodesOperationsListByIspCustomerResourceSample.ts b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCacheNodesOperationsListByIspCustomerResourceSample.ts new file mode 100644 index 00000000000..50ad1580e0b --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCacheNodesOperationsListByIspCustomerResourceSample.ts @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to this api retrieves information about all ispCacheNode resources under the given subscription and resource group + * + * @summary this api retrieves information about all ispCacheNode resources under the given subscription and resource group + * x-ms-original-file: 2023-05-01-preview/IspCacheNodesOperations_ListByIspCustomerResource_MaximumSet_Gen.json + */ +async function ispCacheNodesOperationsListByIspCustomerResource() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.ispCacheNodesOperations.listByIspCustomerResource( + "rgConnectedCache", + "MccRPTest1", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + ispCacheNodesOperationsListByIspCustomerResource(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCacheNodesOperationsUpdateSample.ts b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCacheNodesOperationsUpdateSample.ts new file mode 100644 index 00000000000..523386d6fcd --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCacheNodesOperationsUpdateSample.ts @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to this api updates an existing ispCacheNode resource + * + * @summary this api updates an existing ispCacheNode resource + * x-ms-original-file: 2023-05-01-preview/IspCacheNodesOperations_Update_MaximumSet_Gen.json + */ +async function ispCacheNodesOperationsUpdate() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const result = await client.ispCacheNodesOperations.update( + "rgConnectedCache", + "MccRPTest1", + "MCCCachenode1", + { tags: { key1653: "nzjczrhclhkndesgy" } }, + ); + console.log(result); +} + +async function main() { + ispCacheNodesOperationsUpdate(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCustomersCreateOrUpdateSample.ts b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCustomersCreateOrUpdateSample.ts new file mode 100644 index 00000000000..02479a5229c --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCustomersCreateOrUpdateSample.ts @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to this api creates an ispCustomer with the specified create parameters + * + * @summary this api creates an ispCustomer with the specified create parameters + * x-ms-original-file: 2023-05-01-preview/IspCustomers_CreateOrUpdate_MaximumSet_Gen.json + */ +async function ispCustomerCreateOrUpdateGeneratedByMaximumSetRule() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const result = await client.ispCustomers.createOrUpdate( + "rgConnectedCache", + "MccRPTest2", + { + location: "westus", + properties: { + customer: { + fullyQualifiedResourceId: "uqsbtgae", + customerName: "mkpzynfqihnjfdbaqbqwyhd", + contactEmail: "xquos", + contactPhone: "vue", + contactName: "wxyqjoyoscmvimgwhpitxky", + isEntitled: true, + releaseVersion: 20, + clientTenantId: "fproidkpgvpdnac", + isEnterpriseManaged: true, + shouldMigrate: true, + resendSignupCode: true, + verifySignupCode: true, + verifySignupPhrase: "tprjvttkgmrqlsyicnidhm", + }, + additionalCustomerProperties: { + customerEmail: "zdjgibsidydyzm", + customerTransitAsn: "habgklnxqzmozqpazoyejwiphezpi", + customerAsn: "hgrelgnrtdkleisnepfolu", + customerEntitlementSkuId: "b", + customerEntitlementSkuGuid: "rvzmdpxyflgqetvpwupnfaxsweiiz", + customerEntitlementSkuName: "waaqfijr", + customerEntitlementExpiration: new Date("2024-01-30T00:54:04.773Z"), + optionalProperty1: "qhmwxza", + optionalProperty2: "l", + optionalProperty3: "mblwwvbie", + optionalProperty4: "vzuek", + optionalProperty5: "fzjodscdfcdr", + }, + error: {}, + }, + tags: { key1878: "warz" }, + }, + ); + console.log(result); +} + +async function main() { + ispCustomerCreateOrUpdateGeneratedByMaximumSetRule(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCustomersDeleteSample.ts b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCustomersDeleteSample.ts new file mode 100644 index 00000000000..a9d3fe43689 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCustomersDeleteSample.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to this api deletes an existing ispCustomer resource + * + * @summary this api deletes an existing ispCustomer resource + * x-ms-original-file: 2023-05-01-preview/IspCustomers_Delete_MaximumSet_Gen.json + */ +async function ispCustomersDeleteGeneratedByMaximumSetRule() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + await client.ispCustomers.delete( + "rgConnectedCache", + "hdontfoythjsaeyjhrakckgimgchxwzttbcnvntpvdsgeumxpgnjurptd", + ); +} + +async function main() { + ispCustomersDeleteGeneratedByMaximumSetRule(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCustomersGetSample.ts b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCustomersGetSample.ts new file mode 100644 index 00000000000..69690a4d6bb --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCustomersGetSample.ts @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets the ispCustomer resource information using this get call + * + * @summary gets the ispCustomer resource information using this get call + * x-ms-original-file: 2023-05-01-preview/IspCustomers_Get_MaximumSet_Gen.json + */ +async function ispCustomersGetGeneratedByMaximumSetRule() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const result = await client.ispCustomers.get( + "rgConnectedCache", + "cmcjfueweicolcjkwmsuvcj", + ); + console.log(result); +} + +async function main() { + ispCustomersGetGeneratedByMaximumSetRule(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCustomersListByResourceGroupSample.ts b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCustomersListByResourceGroupSample.ts new file mode 100644 index 00000000000..a4be25c2d0b --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCustomersListByResourceGroupSample.ts @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to this api gets the information about all ispCustomer resources under the given subscription and resource group + * + * @summary this api gets the information about all ispCustomer resources under the given subscription and resource group + * x-ms-original-file: 2023-05-01-preview/IspCustomers_ListByResourceGroup_MaximumSet_Gen.json + */ +async function ispCustomersResourceListByResourceGroupGeneratedByMaximumSetRule() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.ispCustomers.listByResourceGroup( + "rgConnectedCache", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + ispCustomersResourceListByResourceGroupGeneratedByMaximumSetRule(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCustomersListBySubscriptionSample.ts b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCustomersListBySubscriptionSample.ts new file mode 100644 index 00000000000..70e33e5e591 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCustomersListBySubscriptionSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to this api gets information about all ispCustomer resources under the given subscription + * + * @summary this api gets information about all ispCustomer resources under the given subscription + * x-ms-original-file: 2023-05-01-preview/IspCustomers_ListBySubscription_MaximumSet_Gen.json + */ +async function ispCustomerListBySubscriptionGeneratedByMaximumSetRule() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.ispCustomers.listBySubscription()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + ispCustomerListBySubscriptionGeneratedByMaximumSetRule(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCustomersUpdateSample.ts b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCustomersUpdateSample.ts new file mode 100644 index 00000000000..c2747892225 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/ispCustomersUpdateSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to this api updates an existing ispCustomer resource + * + * @summary this api updates an existing ispCustomer resource + * x-ms-original-file: 2023-05-01-preview/IspCustomers_Update_MaximumSet_Gen.json + */ +async function ispCustomerUpdateDetailsGeneratedByMaximumSetRule() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const result = await client.ispCustomers.update( + "rgConnectedCache", + "MccRPTest2", + { tags: { key1653: "nzjczrhclhkndesgy" } }, + ); + console.log(result); +} + +async function main() { + ispCustomerUpdateDetailsGeneratedByMaximumSetRule(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/operationsListSample.ts b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/operationsListSample.ts new file mode 100644 index 00000000000..913ce5c48be --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/src/operationsListSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "@azure/arm-connectedcache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to list the operations for the provider + * + * @summary list the operations for the provider + * x-ms-original-file: 2023-05-01-preview/Operations_List_MaximumSet_Gen.json + */ +async function listTheOperationsForTheProviderGeneratedByMaximumSetRule() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new ConnectedCacheClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.operations.list()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + listTheOperationsForTheProviderGeneratedByMaximumSetRule(); +} + +main().catch(console.error); diff --git a/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/tsconfig.json b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/tsconfig.json new file mode 100644 index 00000000000..984eed535aa --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/samples/v1-beta/typescript/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "target": "ES2020", + "module": "commonjs", + "moduleResolution": "node", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "strict": true, + "alwaysStrict": true, + "outDir": "dist", + "rootDir": "src" + }, + "include": [ + "src/**/*.ts" + ] +} diff --git a/sdk/connectedcache/arm-connectedcache/src/api/cacheNodesOperations/index.ts b/sdk/connectedcache/arm-connectedcache/src/api/cacheNodesOperations/index.ts new file mode 100644 index 00000000000..4453d0fff8a --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/src/api/cacheNodesOperations/index.ts @@ -0,0 +1,338 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { + CacheNodesOperationsCreateorUpdateOptionalParams, + CacheNodesOperationsDeleteOptionalParams, + CacheNodesOperationsGetOptionalParams, + CacheNodesOperationsListByResourceGroupOptionalParams, + CacheNodesOperationsListBySubscriptionOptionalParams, + CacheNodesOperationsUpdateOptionalParams, + ConnectedCacheContext as Client, +} from "../index.js"; +import { + ConnectedCachePatchResource, + connectedCachePatchResourceSerializer, + CacheNodePreviewResource, + cacheNodePreviewResourceSerializer, + cacheNodePreviewResourceDeserializer, + _CacheNodePreviewResourceListResult, + _cacheNodePreviewResourceListResultDeserializer, +} from "../../models/models.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +export function _cacheNodesOperationsGetSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + customerResourceName: string, + options: CacheNodesOperationsGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/cacheNodes/{customerResourceName}", + subscriptionId, + resourceGroupName, + customerResourceName, + ) + .get({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _cacheNodesOperationsGetDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + throw createRestError(result); + } + + return cacheNodePreviewResourceDeserializer(result.body); +} + +/** Retrieves the properties of a cacheNodes */ +export async function cacheNodesOperationsGet( + context: Client, + subscriptionId: string, + resourceGroupName: string, + customerResourceName: string, + options: CacheNodesOperationsGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _cacheNodesOperationsGetSend( + context, + subscriptionId, + resourceGroupName, + customerResourceName, + options, + ); + return _cacheNodesOperationsGetDeserialize(result); +} + +export function _cacheNodesOperationsCreateorUpdateSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + customerResourceName: string, + resource: CacheNodePreviewResource, + options: CacheNodesOperationsCreateorUpdateOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/cacheNodes/{customerResourceName}", + subscriptionId, + resourceGroupName, + customerResourceName, + ) + .put({ + ...operationOptionsToRequestParameters(options), + body: cacheNodePreviewResourceSerializer(resource), + }); +} + +export async function _cacheNodesOperationsCreateorUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201"]; + if (!expectedStatuses.includes(result.status)) { + throw createRestError(result); + } + + return cacheNodePreviewResourceDeserializer(result.body); +} + +/** Creates a cacheNodes with the specified create parameters */ +export function cacheNodesOperationsCreateorUpdate( + context: Client, + subscriptionId: string, + resourceGroupName: string, + customerResourceName: string, + resource: CacheNodePreviewResource, + options: CacheNodesOperationsCreateorUpdateOptionalParams = { + requestOptions: {}, + }, +): PollerLike, CacheNodePreviewResource> { + return getLongRunningPoller( + context, + _cacheNodesOperationsCreateorUpdateDeserialize, + ["200", "201"], + { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _cacheNodesOperationsCreateorUpdateSend( + context, + subscriptionId, + resourceGroupName, + customerResourceName, + resource, + options, + ), + resourceLocationConfig: "azure-async-operation", + }, + ) as PollerLike, CacheNodePreviewResource>; +} + +export function _cacheNodesOperationsDeleteSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + customerResourceName: string, + options: CacheNodesOperationsDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/cacheNodes/{customerResourceName}", + subscriptionId, + resourceGroupName, + customerResourceName, + ) + .delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _cacheNodesOperationsDeleteDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "204"]; + if (!expectedStatuses.includes(result.status)) { + throw createRestError(result); + } + + return; +} + +/** Deletes an existing cache Node */ +export async function cacheNodesOperationsDelete( + context: Client, + subscriptionId: string, + resourceGroupName: string, + customerResourceName: string, + options: CacheNodesOperationsDeleteOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _cacheNodesOperationsDeleteSend( + context, + subscriptionId, + resourceGroupName, + customerResourceName, + options, + ); + return _cacheNodesOperationsDeleteDeserialize(result); +} + +export function _cacheNodesOperationsUpdateSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + customerResourceName: string, + properties: ConnectedCachePatchResource, + options: CacheNodesOperationsUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/cacheNodes/{customerResourceName}", + subscriptionId, + resourceGroupName, + customerResourceName, + ) + .patch({ + ...operationOptionsToRequestParameters(options), + body: connectedCachePatchResourceSerializer(properties), + }); +} + +export async function _cacheNodesOperationsUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + throw createRestError(result); + } + + return cacheNodePreviewResourceDeserializer(result.body); +} + +/** updates an existing Cache Node */ +export async function cacheNodesOperationsUpdate( + context: Client, + subscriptionId: string, + resourceGroupName: string, + customerResourceName: string, + properties: ConnectedCachePatchResource, + options: CacheNodesOperationsUpdateOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _cacheNodesOperationsUpdateSend( + context, + subscriptionId, + resourceGroupName, + customerResourceName, + properties, + options, + ); + return _cacheNodesOperationsUpdateDeserialize(result); +} + +export function _cacheNodesOperationsListByResourceGroupSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + options: CacheNodesOperationsListByResourceGroupOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/cacheNodes", + subscriptionId, + resourceGroupName, + ) + .get({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _cacheNodesOperationsListByResourceGroupDeserialize( + result: PathUncheckedResponse, +): Promise<_CacheNodePreviewResourceListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + throw createRestError(result); + } + + return _cacheNodePreviewResourceListResultDeserializer(result.body); +} + +/** Retrieves the properties of all ConnectedCache */ +export function cacheNodesOperationsListByResourceGroup( + context: Client, + subscriptionId: string, + resourceGroupName: string, + options: CacheNodesOperationsListByResourceGroupOptionalParams = { + requestOptions: {}, + }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => + _cacheNodesOperationsListByResourceGroupSend( + context, + subscriptionId, + resourceGroupName, + options, + ), + _cacheNodesOperationsListByResourceGroupDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _cacheNodesOperationsListBySubscriptionSend( + context: Client, + subscriptionId: string, + options: CacheNodesOperationsListBySubscriptionOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + return context + .path( + "/subscriptions/{subscriptionId}/providers/Microsoft.ConnectedCache/cacheNodes", + subscriptionId, + ) + .get({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _cacheNodesOperationsListBySubscriptionDeserialize( + result: PathUncheckedResponse, +): Promise<_CacheNodePreviewResourceListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + throw createRestError(result); + } + + return _cacheNodePreviewResourceListResultDeserializer(result.body); +} + +/** Retrieves the properties of all ConnectedCaches */ +export function cacheNodesOperationsListBySubscription( + context: Client, + subscriptionId: string, + options: CacheNodesOperationsListBySubscriptionOptionalParams = { + requestOptions: {}, + }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _cacheNodesOperationsListBySubscriptionSend(context, subscriptionId, options), + _cacheNodesOperationsListBySubscriptionDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} diff --git a/sdk/connectedcache/arm-connectedcache/src/api/connectedCacheContext.ts b/sdk/connectedcache/arm-connectedcache/src/api/connectedCacheContext.ts new file mode 100644 index 00000000000..3d6d62350f6 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/src/api/connectedCacheContext.ts @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { logger } from "../logger.js"; +import { KnownVersions } from "../models/models.js"; +import { Client, ClientOptions, getClient } from "@azure-rest/core-client"; +import { TokenCredential } from "@azure/core-auth"; + +/** Microsoft Connected Cache Rest Api version 2023-05-01-preview */ +export interface ConnectedCacheContext extends Client {} + +/** Optional parameters for the client. */ +export interface ConnectedCacheClientOptionalParams extends ClientOptions { + /** The API version to use for this operation. */ + /** Known values of {@link KnownVersions} that the service accepts. */ + apiVersion?: string; +} + +/** Microsoft Connected Cache Rest Api version 2023-05-01-preview */ +export function createConnectedCache( + credential: TokenCredential, + options: ConnectedCacheClientOptionalParams = {}, +): ConnectedCacheContext { + const endpointUrl = options.endpoint ?? options.baseUrl ?? `https://management.azure.com`; + const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix; + const userAgentInfo = `azsdk-js-arm-connectedcache/1.0.0-beta.1`; + const userAgentPrefix = prefixFromOptions + ? `${prefixFromOptions} azsdk-js-api ${userAgentInfo}` + : `azsdk-js-api ${userAgentInfo}`; + const { apiVersion: _, ...updatedOptions } = { + ...options, + userAgentOptions: { userAgentPrefix }, + loggingOptions: { logger: options.loggingOptions?.logger ?? logger.info }, + credentials: { + scopes: options.credentials?.scopes ?? [`${endpointUrl}/.default`], + }, + }; + const clientContext = getClient(endpointUrl, credential, updatedOptions); + clientContext.pipeline.removePolicy({ name: "ApiVersionPolicy" }); + const apiVersion = options.apiVersion ?? "2023-05-01-preview"; + clientContext.pipeline.addPolicy({ + name: "ClientApiVersionPolicy", + sendRequest: (req, next) => { + // Use the apiVersion defined in request url directly + // Append one if there is no apiVersion and we have one at client options + const url = new URL(req.url); + if (!url.searchParams.get("api-version")) { + req.url = `${req.url}${ + Array.from(url.searchParams.keys()).length > 0 ? "&" : "?" + }api-version=${apiVersion}`; + } + + return next(req); + }, + }); + return clientContext; +} diff --git a/sdk/connectedcache/arm-connectedcache/src/api/enterpriseCustomerOperations/index.ts b/sdk/connectedcache/arm-connectedcache/src/api/enterpriseCustomerOperations/index.ts new file mode 100644 index 00000000000..55b4206fe53 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/src/api/enterpriseCustomerOperations/index.ts @@ -0,0 +1,350 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { + ConnectedCacheContext as Client, + EnterpriseCustomerOperationsCreateOrUpdateOptionalParams, + EnterpriseCustomerOperationsDeleteOptionalParams, + EnterpriseCustomerOperationsGetOptionalParams, + EnterpriseCustomerOperationsListByResourceGroupOptionalParams, + EnterpriseCustomerOperationsListBySubscriptionOptionalParams, + EnterpriseCustomerOperationsUpdateOptionalParams, +} from "../index.js"; +import { + ConnectedCachePatchResource, + connectedCachePatchResourceSerializer, + EnterprisePreviewResource, + enterprisePreviewResourceSerializer, + enterprisePreviewResourceDeserializer, + _EnterprisePreviewResourceListResult, + _enterprisePreviewResourceListResultDeserializer, +} from "../../models/models.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +export function _enterpriseCustomerOperationsGetSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + customerResourceName: string, + options: EnterpriseCustomerOperationsGetOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseCustomers/{customerResourceName}", + subscriptionId, + resourceGroupName, + customerResourceName, + ) + .get({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _enterpriseCustomerOperationsGetDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + throw createRestError(result); + } + + return enterprisePreviewResourceDeserializer(result.body); +} + +/** Retrieves the properties of a Enterprise customer */ +export async function enterpriseCustomerOperationsGet( + context: Client, + subscriptionId: string, + resourceGroupName: string, + customerResourceName: string, + options: EnterpriseCustomerOperationsGetOptionalParams = { + requestOptions: {}, + }, +): Promise { + const result = await _enterpriseCustomerOperationsGetSend( + context, + subscriptionId, + resourceGroupName, + customerResourceName, + options, + ); + return _enterpriseCustomerOperationsGetDeserialize(result); +} + +export function _enterpriseCustomerOperationsCreateOrUpdateSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + customerResourceName: string, + resource: EnterprisePreviewResource, + options: EnterpriseCustomerOperationsCreateOrUpdateOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseCustomers/{customerResourceName}", + subscriptionId, + resourceGroupName, + customerResourceName, + ) + .put({ + ...operationOptionsToRequestParameters(options), + body: enterprisePreviewResourceSerializer(resource), + }); +} + +export async function _enterpriseCustomerOperationsCreateOrUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201"]; + if (!expectedStatuses.includes(result.status)) { + throw createRestError(result); + } + + return enterprisePreviewResourceDeserializer(result.body); +} + +/** Creates a cacheNodes with the specified create parameters */ +export function enterpriseCustomerOperationsCreateOrUpdate( + context: Client, + subscriptionId: string, + resourceGroupName: string, + customerResourceName: string, + resource: EnterprisePreviewResource, + options: EnterpriseCustomerOperationsCreateOrUpdateOptionalParams = { + requestOptions: {}, + }, +): PollerLike, EnterprisePreviewResource> { + return getLongRunningPoller( + context, + _enterpriseCustomerOperationsCreateOrUpdateDeserialize, + ["200", "201"], + { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _enterpriseCustomerOperationsCreateOrUpdateSend( + context, + subscriptionId, + resourceGroupName, + customerResourceName, + resource, + options, + ), + resourceLocationConfig: "azure-async-operation", + }, + ) as PollerLike, EnterprisePreviewResource>; +} + +export function _enterpriseCustomerOperationsUpdateSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + customerResourceName: string, + properties: ConnectedCachePatchResource, + options: EnterpriseCustomerOperationsUpdateOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseCustomers/{customerResourceName}", + subscriptionId, + resourceGroupName, + customerResourceName, + ) + .patch({ + ...operationOptionsToRequestParameters(options), + body: connectedCachePatchResourceSerializer(properties), + }); +} + +export async function _enterpriseCustomerOperationsUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + throw createRestError(result); + } + + return enterprisePreviewResourceDeserializer(result.body); +} + +/** updates an existing enterpriseCustomers */ +export async function enterpriseCustomerOperationsUpdate( + context: Client, + subscriptionId: string, + resourceGroupName: string, + customerResourceName: string, + properties: ConnectedCachePatchResource, + options: EnterpriseCustomerOperationsUpdateOptionalParams = { + requestOptions: {}, + }, +): Promise { + const result = await _enterpriseCustomerOperationsUpdateSend( + context, + subscriptionId, + resourceGroupName, + customerResourceName, + properties, + options, + ); + return _enterpriseCustomerOperationsUpdateDeserialize(result); +} + +export function _enterpriseCustomerOperationsDeleteSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + customerResourceName: string, + options: EnterpriseCustomerOperationsDeleteOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseCustomers/{customerResourceName}", + subscriptionId, + resourceGroupName, + customerResourceName, + ) + .delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _enterpriseCustomerOperationsDeleteDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "204"]; + if (!expectedStatuses.includes(result.status)) { + throw createRestError(result); + } + + return; +} + +/** Deletes an existing customer Enterprise resource */ +export async function enterpriseCustomerOperationsDelete( + context: Client, + subscriptionId: string, + resourceGroupName: string, + customerResourceName: string, + options: EnterpriseCustomerOperationsDeleteOptionalParams = { + requestOptions: {}, + }, +): Promise { + const result = await _enterpriseCustomerOperationsDeleteSend( + context, + subscriptionId, + resourceGroupName, + customerResourceName, + options, + ); + return _enterpriseCustomerOperationsDeleteDeserialize(result); +} + +export function _enterpriseCustomerOperationsListByResourceGroupSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + options: EnterpriseCustomerOperationsListByResourceGroupOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseCustomers", + subscriptionId, + resourceGroupName, + ) + .get({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _enterpriseCustomerOperationsListByResourceGroupDeserialize( + result: PathUncheckedResponse, +): Promise<_EnterprisePreviewResourceListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + throw createRestError(result); + } + + return _enterprisePreviewResourceListResultDeserializer(result.body); +} + +/** Retrieves the properties of all ConnectedCache enterpriseCustomers */ +export function enterpriseCustomerOperationsListByResourceGroup( + context: Client, + subscriptionId: string, + resourceGroupName: string, + options: EnterpriseCustomerOperationsListByResourceGroupOptionalParams = { + requestOptions: {}, + }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => + _enterpriseCustomerOperationsListByResourceGroupSend( + context, + subscriptionId, + resourceGroupName, + options, + ), + _enterpriseCustomerOperationsListByResourceGroupDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _enterpriseCustomerOperationsListBySubscriptionSend( + context: Client, + subscriptionId: string, + options: EnterpriseCustomerOperationsListBySubscriptionOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + return context + .path( + "/subscriptions/{subscriptionId}/providers/Microsoft.ConnectedCache/enterpriseCustomers", + subscriptionId, + ) + .get({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _enterpriseCustomerOperationsListBySubscriptionDeserialize( + result: PathUncheckedResponse, +): Promise<_EnterprisePreviewResourceListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + throw createRestError(result); + } + + return _enterprisePreviewResourceListResultDeserializer(result.body); +} + +/** Retrieves the properties of all ConnectedCaches */ +export function enterpriseCustomerOperationsListBySubscription( + context: Client, + subscriptionId: string, + options: EnterpriseCustomerOperationsListBySubscriptionOptionalParams = { + requestOptions: {}, + }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _enterpriseCustomerOperationsListBySubscriptionSend(context, subscriptionId, options), + _enterpriseCustomerOperationsListBySubscriptionDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} diff --git a/sdk/connectedcache/arm-connectedcache/src/api/enterpriseMccCacheNodesOperations/index.ts b/sdk/connectedcache/arm-connectedcache/src/api/enterpriseMccCacheNodesOperations/index.ts new file mode 100644 index 00000000000..578a622ca5e --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/src/api/enterpriseMccCacheNodesOperations/index.ts @@ -0,0 +1,393 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { + ConnectedCacheContext as Client, + EnterpriseMccCacheNodesOperationsCreateOrUpdateOptionalParams, + EnterpriseMccCacheNodesOperationsDeleteOptionalParams, + EnterpriseMccCacheNodesOperationsGetCacheNodeInstallDetailsOptionalParams, + EnterpriseMccCacheNodesOperationsGetOptionalParams, + EnterpriseMccCacheNodesOperationsListByEnterpriseMccCustomerResourceOptionalParams, + EnterpriseMccCacheNodesOperationsUpdateOptionalParams, +} from "../index.js"; +import { + EnterpriseMccCacheNodeResource, + enterpriseMccCacheNodeResourceSerializer, + enterpriseMccCacheNodeResourceDeserializer, + ConnectedCachePatchResource, + connectedCachePatchResourceSerializer, + _EnterpriseMccCacheNodeResourceListResult, + _enterpriseMccCacheNodeResourceListResultDeserializer, + MccCacheNodeInstallDetails, + mccCacheNodeInstallDetailsDeserializer, +} from "../../models/models.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +export function _enterpriseMccCacheNodesOperationsGetSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + customerResourceName: string, + cacheNodeResourceName: string, + options: EnterpriseMccCacheNodesOperationsGetOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}/enterpriseMccCacheNodes/{cacheNodeResourceName}", + subscriptionId, + resourceGroupName, + customerResourceName, + cacheNodeResourceName, + ) + .get({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _enterpriseMccCacheNodesOperationsGetDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + throw createRestError(result); + } + + return enterpriseMccCacheNodeResourceDeserializer(result.body); +} + +/** This api gets ispCacheNode resource information */ +export async function enterpriseMccCacheNodesOperationsGet( + context: Client, + subscriptionId: string, + resourceGroupName: string, + customerResourceName: string, + cacheNodeResourceName: string, + options: EnterpriseMccCacheNodesOperationsGetOptionalParams = { + requestOptions: {}, + }, +): Promise { + const result = await _enterpriseMccCacheNodesOperationsGetSend( + context, + subscriptionId, + resourceGroupName, + customerResourceName, + cacheNodeResourceName, + options, + ); + return _enterpriseMccCacheNodesOperationsGetDeserialize(result); +} + +export function _enterpriseMccCacheNodesOperationsCreateOrUpdateSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + customerResourceName: string, + cacheNodeResourceName: string, + resource: EnterpriseMccCacheNodeResource, + options: EnterpriseMccCacheNodesOperationsCreateOrUpdateOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}/enterpriseMccCacheNodes/{cacheNodeResourceName}", + subscriptionId, + resourceGroupName, + customerResourceName, + cacheNodeResourceName, + ) + .put({ + ...operationOptionsToRequestParameters(options), + body: enterpriseMccCacheNodeResourceSerializer(resource), + }); +} + +export async function _enterpriseMccCacheNodesOperationsCreateOrUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201"]; + if (!expectedStatuses.includes(result.status)) { + throw createRestError(result); + } + + return enterpriseMccCacheNodeResourceDeserializer(result.body); +} + +/** This api creates an ispCacheNode with the specified create parameters */ +export function enterpriseMccCacheNodesOperationsCreateOrUpdate( + context: Client, + subscriptionId: string, + resourceGroupName: string, + customerResourceName: string, + cacheNodeResourceName: string, + resource: EnterpriseMccCacheNodeResource, + options: EnterpriseMccCacheNodesOperationsCreateOrUpdateOptionalParams = { + requestOptions: {}, + }, +): PollerLike, EnterpriseMccCacheNodeResource> { + return getLongRunningPoller( + context, + _enterpriseMccCacheNodesOperationsCreateOrUpdateDeserialize, + ["200", "201"], + { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _enterpriseMccCacheNodesOperationsCreateOrUpdateSend( + context, + subscriptionId, + resourceGroupName, + customerResourceName, + cacheNodeResourceName, + resource, + options, + ), + resourceLocationConfig: "azure-async-operation", + }, + ) as PollerLike, EnterpriseMccCacheNodeResource>; +} + +export function _enterpriseMccCacheNodesOperationsUpdateSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + customerResourceName: string, + cacheNodeResourceName: string, + properties: ConnectedCachePatchResource, + options: EnterpriseMccCacheNodesOperationsUpdateOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}/enterpriseMccCacheNodes/{cacheNodeResourceName}", + subscriptionId, + resourceGroupName, + customerResourceName, + cacheNodeResourceName, + ) + .patch({ + ...operationOptionsToRequestParameters(options), + body: connectedCachePatchResourceSerializer(properties), + }); +} + +export async function _enterpriseMccCacheNodesOperationsUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + throw createRestError(result); + } + + return enterpriseMccCacheNodeResourceDeserializer(result.body); +} + +/** This api updates an existing ispCacheNode resource */ +export async function enterpriseMccCacheNodesOperationsUpdate( + context: Client, + subscriptionId: string, + resourceGroupName: string, + customerResourceName: string, + cacheNodeResourceName: string, + properties: ConnectedCachePatchResource, + options: EnterpriseMccCacheNodesOperationsUpdateOptionalParams = { + requestOptions: {}, + }, +): Promise { + const result = await _enterpriseMccCacheNodesOperationsUpdateSend( + context, + subscriptionId, + resourceGroupName, + customerResourceName, + cacheNodeResourceName, + properties, + options, + ); + return _enterpriseMccCacheNodesOperationsUpdateDeserialize(result); +} + +export function _enterpriseMccCacheNodesOperationsDeleteSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + customerResourceName: string, + cacheNodeResourceName: string, + options: EnterpriseMccCacheNodesOperationsDeleteOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}/enterpriseMccCacheNodes/{cacheNodeResourceName}", + subscriptionId, + resourceGroupName, + customerResourceName, + cacheNodeResourceName, + ) + .delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _enterpriseMccCacheNodesOperationsDeleteDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["202", "204", "200"]; + if (!expectedStatuses.includes(result.status)) { + throw createRestError(result); + } + + return; +} + +/** This api deletes an existing ispCacheNode resource */ +export function enterpriseMccCacheNodesOperationsDelete( + context: Client, + subscriptionId: string, + resourceGroupName: string, + customerResourceName: string, + cacheNodeResourceName: string, + options: EnterpriseMccCacheNodesOperationsDeleteOptionalParams = { + requestOptions: {}, + }, +): PollerLike, void> { + return getLongRunningPoller( + context, + _enterpriseMccCacheNodesOperationsDeleteDeserialize, + ["202", "204", "200"], + { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _enterpriseMccCacheNodesOperationsDeleteSend( + context, + subscriptionId, + resourceGroupName, + customerResourceName, + cacheNodeResourceName, + options, + ), + resourceLocationConfig: "location", + }, + ) as PollerLike, void>; +} + +export function _enterpriseMccCacheNodesOperationsListByEnterpriseMccCustomerResourceSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + customerResourceName: string, + options: EnterpriseMccCacheNodesOperationsListByEnterpriseMccCustomerResourceOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}/enterpriseMccCacheNodes", + subscriptionId, + resourceGroupName, + customerResourceName, + ) + .get({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _enterpriseMccCacheNodesOperationsListByEnterpriseMccCustomerResourceDeserialize( + result: PathUncheckedResponse, +): Promise<_EnterpriseMccCacheNodeResourceListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + throw createRestError(result); + } + + return _enterpriseMccCacheNodeResourceListResultDeserializer(result.body); +} + +/** This api retrieves information about all ispCacheNode resources under the given subscription and resource group */ +export function enterpriseMccCacheNodesOperationsListByEnterpriseMccCustomerResource( + context: Client, + subscriptionId: string, + resourceGroupName: string, + customerResourceName: string, + options: EnterpriseMccCacheNodesOperationsListByEnterpriseMccCustomerResourceOptionalParams = { + requestOptions: {}, + }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => + _enterpriseMccCacheNodesOperationsListByEnterpriseMccCustomerResourceSend( + context, + subscriptionId, + resourceGroupName, + customerResourceName, + options, + ), + _enterpriseMccCacheNodesOperationsListByEnterpriseMccCustomerResourceDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _enterpriseMccCacheNodesOperationsGetCacheNodeInstallDetailsSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + customerResourceName: string, + cacheNodeResourceName: string, + options: EnterpriseMccCacheNodesOperationsGetCacheNodeInstallDetailsOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}/enterpriseMccCacheNodes/{cacheNodeResourceName}/getCacheNodeInstallDetails", + subscriptionId, + resourceGroupName, + customerResourceName, + cacheNodeResourceName, + ) + .post({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _enterpriseMccCacheNodesOperationsGetCacheNodeInstallDetailsDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + throw createRestError(result); + } + + return mccCacheNodeInstallDetailsDeserializer(result.body); +} + +/** This api gets secrets of the ispCacheNode resource install details */ +export async function enterpriseMccCacheNodesOperationsGetCacheNodeInstallDetails( + context: Client, + subscriptionId: string, + resourceGroupName: string, + customerResourceName: string, + cacheNodeResourceName: string, + options: EnterpriseMccCacheNodesOperationsGetCacheNodeInstallDetailsOptionalParams = { + requestOptions: {}, + }, +): Promise { + const result = await _enterpriseMccCacheNodesOperationsGetCacheNodeInstallDetailsSend( + context, + subscriptionId, + resourceGroupName, + customerResourceName, + cacheNodeResourceName, + options, + ); + return _enterpriseMccCacheNodesOperationsGetCacheNodeInstallDetailsDeserialize(result); +} diff --git a/sdk/connectedcache/arm-connectedcache/src/api/enterpriseMccCustomers/index.ts b/sdk/connectedcache/arm-connectedcache/src/api/enterpriseMccCustomers/index.ts new file mode 100644 index 00000000000..5e494147eaf --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/src/api/enterpriseMccCustomers/index.ts @@ -0,0 +1,348 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { + ConnectedCacheContext as Client, + EnterpriseMccCustomersCreateOrUpdateOptionalParams, + EnterpriseMccCustomersDeleteOptionalParams, + EnterpriseMccCustomersGetOptionalParams, + EnterpriseMccCustomersListByResourceGroupOptionalParams, + EnterpriseMccCustomersListBySubscriptionOptionalParams, + EnterpriseMccCustomersUpdateOptionalParams, +} from "../index.js"; +import { + ConnectedCachePatchResource, + connectedCachePatchResourceSerializer, + EnterpriseMccCustomerResource, + enterpriseMccCustomerResourceSerializer, + enterpriseMccCustomerResourceDeserializer, + _EnterpriseMccCustomerResourceListResult, + _enterpriseMccCustomerResourceListResultDeserializer, +} from "../../models/models.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +export function _enterpriseMccCustomersGetSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + customerResourceName: string, + options: EnterpriseMccCustomersGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}", + subscriptionId, + resourceGroupName, + customerResourceName, + ) + .get({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _enterpriseMccCustomersGetDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + throw createRestError(result); + } + + return enterpriseMccCustomerResourceDeserializer(result.body); +} + +/** Gets the enterprise mcc customer resource information using this get call */ +export async function enterpriseMccCustomersGet( + context: Client, + subscriptionId: string, + resourceGroupName: string, + customerResourceName: string, + options: EnterpriseMccCustomersGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _enterpriseMccCustomersGetSend( + context, + subscriptionId, + resourceGroupName, + customerResourceName, + options, + ); + return _enterpriseMccCustomersGetDeserialize(result); +} + +export function _enterpriseMccCustomersCreateOrUpdateSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + customerResourceName: string, + resource: EnterpriseMccCustomerResource, + options: EnterpriseMccCustomersCreateOrUpdateOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}", + subscriptionId, + resourceGroupName, + customerResourceName, + ) + .put({ + ...operationOptionsToRequestParameters(options), + body: enterpriseMccCustomerResourceSerializer(resource), + }); +} + +export async function _enterpriseMccCustomersCreateOrUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201"]; + if (!expectedStatuses.includes(result.status)) { + throw createRestError(result); + } + + return enterpriseMccCustomerResourceDeserializer(result.body); +} + +/** This api creates an enterprise mcc customer with the specified create parameters */ +export function enterpriseMccCustomersCreateOrUpdate( + context: Client, + subscriptionId: string, + resourceGroupName: string, + customerResourceName: string, + resource: EnterpriseMccCustomerResource, + options: EnterpriseMccCustomersCreateOrUpdateOptionalParams = { + requestOptions: {}, + }, +): PollerLike, EnterpriseMccCustomerResource> { + return getLongRunningPoller( + context, + _enterpriseMccCustomersCreateOrUpdateDeserialize, + ["200", "201"], + { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _enterpriseMccCustomersCreateOrUpdateSend( + context, + subscriptionId, + resourceGroupName, + customerResourceName, + resource, + options, + ), + resourceLocationConfig: "azure-async-operation", + }, + ) as PollerLike, EnterpriseMccCustomerResource>; +} + +export function _enterpriseMccCustomersUpdateSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + customerResourceName: string, + properties: ConnectedCachePatchResource, + options: EnterpriseMccCustomersUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}", + subscriptionId, + resourceGroupName, + customerResourceName, + ) + .patch({ + ...operationOptionsToRequestParameters(options), + body: connectedCachePatchResourceSerializer(properties), + }); +} + +export async function _enterpriseMccCustomersUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + throw createRestError(result); + } + + return enterpriseMccCustomerResourceDeserializer(result.body); +} + +/** This api updates an existing enterprise mcc customer resource */ +export async function enterpriseMccCustomersUpdate( + context: Client, + subscriptionId: string, + resourceGroupName: string, + customerResourceName: string, + properties: ConnectedCachePatchResource, + options: EnterpriseMccCustomersUpdateOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _enterpriseMccCustomersUpdateSend( + context, + subscriptionId, + resourceGroupName, + customerResourceName, + properties, + options, + ); + return _enterpriseMccCustomersUpdateDeserialize(result); +} + +export function _enterpriseMccCustomersDeleteSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + customerResourceName: string, + options: EnterpriseMccCustomersDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}", + subscriptionId, + resourceGroupName, + customerResourceName, + ) + .delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _enterpriseMccCustomersDeleteDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["202", "204", "200"]; + if (!expectedStatuses.includes(result.status)) { + throw createRestError(result); + } + + return; +} + +/** This api deletes an existing enterprise mcc customer resource */ +export function enterpriseMccCustomersDelete( + context: Client, + subscriptionId: string, + resourceGroupName: string, + customerResourceName: string, + options: EnterpriseMccCustomersDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller( + context, + _enterpriseMccCustomersDeleteDeserialize, + ["202", "204", "200"], + { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _enterpriseMccCustomersDeleteSend( + context, + subscriptionId, + resourceGroupName, + customerResourceName, + options, + ), + resourceLocationConfig: "location", + }, + ) as PollerLike, void>; +} + +export function _enterpriseMccCustomersListByResourceGroupSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + options: EnterpriseMccCustomersListByResourceGroupOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers", + subscriptionId, + resourceGroupName, + ) + .get({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _enterpriseMccCustomersListByResourceGroupDeserialize( + result: PathUncheckedResponse, +): Promise<_EnterpriseMccCustomerResourceListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + throw createRestError(result); + } + + return _enterpriseMccCustomerResourceListResultDeserializer(result.body); +} + +/** This api gets the information about all enterprise mcc customer resources under the given subscription and resource group */ +export function enterpriseMccCustomersListByResourceGroup( + context: Client, + subscriptionId: string, + resourceGroupName: string, + options: EnterpriseMccCustomersListByResourceGroupOptionalParams = { + requestOptions: {}, + }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => + _enterpriseMccCustomersListByResourceGroupSend( + context, + subscriptionId, + resourceGroupName, + options, + ), + _enterpriseMccCustomersListByResourceGroupDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _enterpriseMccCustomersListBySubscriptionSend( + context: Client, + subscriptionId: string, + options: EnterpriseMccCustomersListBySubscriptionOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + return context + .path( + "/subscriptions/{subscriptionId}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers", + subscriptionId, + ) + .get({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _enterpriseMccCustomersListBySubscriptionDeserialize( + result: PathUncheckedResponse, +): Promise<_EnterpriseMccCustomerResourceListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + throw createRestError(result); + } + + return _enterpriseMccCustomerResourceListResultDeserializer(result.body); +} + +/** This api gets information about all enterpriseMccCustomer resources under the given subscription */ +export function enterpriseMccCustomersListBySubscription( + context: Client, + subscriptionId: string, + options: EnterpriseMccCustomersListBySubscriptionOptionalParams = { + requestOptions: {}, + }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _enterpriseMccCustomersListBySubscriptionSend(context, subscriptionId, options), + _enterpriseMccCustomersListBySubscriptionDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} diff --git a/sdk/connectedcache/arm-connectedcache/src/api/index.ts b/sdk/connectedcache/arm-connectedcache/src/api/index.ts new file mode 100644 index 00000000000..7d8d4b81309 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/src/api/index.ts @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + createConnectedCache, + ConnectedCacheContext, + ConnectedCacheClientOptionalParams, +} from "./connectedCacheContext.js"; +export { + OperationsListOptionalParams, + EnterpriseCustomerOperationsGetOptionalParams, + EnterpriseCustomerOperationsCreateOrUpdateOptionalParams, + EnterpriseCustomerOperationsUpdateOptionalParams, + EnterpriseCustomerOperationsDeleteOptionalParams, + EnterpriseCustomerOperationsListByResourceGroupOptionalParams, + EnterpriseCustomerOperationsListBySubscriptionOptionalParams, + CacheNodesOperationsGetOptionalParams, + CacheNodesOperationsCreateorUpdateOptionalParams, + CacheNodesOperationsDeleteOptionalParams, + CacheNodesOperationsUpdateOptionalParams, + CacheNodesOperationsListByResourceGroupOptionalParams, + CacheNodesOperationsListBySubscriptionOptionalParams, + IspCustomersGetOptionalParams, + IspCustomersCreateOrUpdateOptionalParams, + IspCustomersUpdateOptionalParams, + IspCustomersDeleteOptionalParams, + IspCustomersListByResourceGroupOptionalParams, + IspCustomersListBySubscriptionOptionalParams, + IspCacheNodesOperationsGetOptionalParams, + IspCacheNodesOperationsCreateOrUpdateOptionalParams, + IspCacheNodesOperationsUpdateOptionalParams, + IspCacheNodesOperationsDeleteOptionalParams, + IspCacheNodesOperationsListByIspCustomerResourceOptionalParams, + IspCacheNodesOperationsGetBgpCidrsOptionalParams, + IspCacheNodesOperationsGetCacheNodeInstallDetailsOptionalParams, + EnterpriseMccCustomersGetOptionalParams, + EnterpriseMccCustomersCreateOrUpdateOptionalParams, + EnterpriseMccCustomersUpdateOptionalParams, + EnterpriseMccCustomersDeleteOptionalParams, + EnterpriseMccCustomersListByResourceGroupOptionalParams, + EnterpriseMccCustomersListBySubscriptionOptionalParams, + EnterpriseMccCacheNodesOperationsGetOptionalParams, + EnterpriseMccCacheNodesOperationsCreateOrUpdateOptionalParams, + EnterpriseMccCacheNodesOperationsUpdateOptionalParams, + EnterpriseMccCacheNodesOperationsDeleteOptionalParams, + EnterpriseMccCacheNodesOperationsListByEnterpriseMccCustomerResourceOptionalParams, + EnterpriseMccCacheNodesOperationsGetCacheNodeInstallDetailsOptionalParams, +} from "./options.js"; +export { + cacheNodesOperationsGet, + cacheNodesOperationsCreateorUpdate, + cacheNodesOperationsDelete, + cacheNodesOperationsUpdate, + cacheNodesOperationsListByResourceGroup, + cacheNodesOperationsListBySubscription, +} from "./cacheNodesOperations/index.js"; +export { + enterpriseCustomerOperationsGet, + enterpriseCustomerOperationsCreateOrUpdate, + enterpriseCustomerOperationsUpdate, + enterpriseCustomerOperationsDelete, + enterpriseCustomerOperationsListByResourceGroup, + enterpriseCustomerOperationsListBySubscription, +} from "./enterpriseCustomerOperations/index.js"; +export { + enterpriseMccCacheNodesOperationsGet, + enterpriseMccCacheNodesOperationsCreateOrUpdate, + enterpriseMccCacheNodesOperationsUpdate, + enterpriseMccCacheNodesOperationsDelete, + enterpriseMccCacheNodesOperationsListByEnterpriseMccCustomerResource, + enterpriseMccCacheNodesOperationsGetCacheNodeInstallDetails, +} from "./enterpriseMccCacheNodesOperations/index.js"; +export { + enterpriseMccCustomersGet, + enterpriseMccCustomersCreateOrUpdate, + enterpriseMccCustomersUpdate, + enterpriseMccCustomersDelete, + enterpriseMccCustomersListByResourceGroup, + enterpriseMccCustomersListBySubscription, +} from "./enterpriseMccCustomers/index.js"; +export { + ispCacheNodesOperationsGet, + ispCacheNodesOperationsCreateOrUpdate, + ispCacheNodesOperationsUpdate, + ispCacheNodesOperationsDelete, + ispCacheNodesOperationsListByIspCustomerResource, + ispCacheNodesOperationsGetBgpCidrs, + ispCacheNodesOperationsGetCacheNodeInstallDetails, +} from "./ispCacheNodesOperations/index.js"; +export { + ispCustomersGet, + ispCustomersCreateOrUpdate, + ispCustomersUpdate, + ispCustomersDelete, + ispCustomersListByResourceGroup, + ispCustomersListBySubscription, +} from "./ispCustomers/index.js"; +export { operationsList } from "./operations/index.js"; diff --git a/sdk/connectedcache/arm-connectedcache/src/api/ispCacheNodesOperations/index.ts b/sdk/connectedcache/arm-connectedcache/src/api/ispCacheNodesOperations/index.ts new file mode 100644 index 00000000000..743f9586907 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/src/api/ispCacheNodesOperations/index.ts @@ -0,0 +1,438 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { + ConnectedCacheContext as Client, + IspCacheNodesOperationsCreateOrUpdateOptionalParams, + IspCacheNodesOperationsDeleteOptionalParams, + IspCacheNodesOperationsGetBgpCidrsOptionalParams, + IspCacheNodesOperationsGetCacheNodeInstallDetailsOptionalParams, + IspCacheNodesOperationsGetOptionalParams, + IspCacheNodesOperationsListByIspCustomerResourceOptionalParams, + IspCacheNodesOperationsUpdateOptionalParams, +} from "../index.js"; +import { + ConnectedCachePatchResource, + connectedCachePatchResourceSerializer, + MccCacheNodeInstallDetails, + mccCacheNodeInstallDetailsDeserializer, + IspCacheNodeResource, + ispCacheNodeResourceSerializer, + ispCacheNodeResourceDeserializer, + _IspCacheNodeResourceListResult, + _ispCacheNodeResourceListResultDeserializer, + MccCacheNodeBgpCidrDetails, + mccCacheNodeBgpCidrDetailsDeserializer, +} from "../../models/models.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +export function _ispCacheNodesOperationsGetSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + customerResourceName: string, + cacheNodeResourceName: string, + options: IspCacheNodesOperationsGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}/ispCacheNodes/{cacheNodeResourceName}", + subscriptionId, + resourceGroupName, + customerResourceName, + cacheNodeResourceName, + ) + .get({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _ispCacheNodesOperationsGetDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + throw createRestError(result); + } + + return ispCacheNodeResourceDeserializer(result.body); +} + +/** This api gets ispCacheNode resource information */ +export async function ispCacheNodesOperationsGet( + context: Client, + subscriptionId: string, + resourceGroupName: string, + customerResourceName: string, + cacheNodeResourceName: string, + options: IspCacheNodesOperationsGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _ispCacheNodesOperationsGetSend( + context, + subscriptionId, + resourceGroupName, + customerResourceName, + cacheNodeResourceName, + options, + ); + return _ispCacheNodesOperationsGetDeserialize(result); +} + +export function _ispCacheNodesOperationsCreateOrUpdateSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + customerResourceName: string, + cacheNodeResourceName: string, + resource: IspCacheNodeResource, + options: IspCacheNodesOperationsCreateOrUpdateOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}/ispCacheNodes/{cacheNodeResourceName}", + subscriptionId, + resourceGroupName, + customerResourceName, + cacheNodeResourceName, + ) + .put({ + ...operationOptionsToRequestParameters(options), + body: ispCacheNodeResourceSerializer(resource), + }); +} + +export async function _ispCacheNodesOperationsCreateOrUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201"]; + if (!expectedStatuses.includes(result.status)) { + throw createRestError(result); + } + + return ispCacheNodeResourceDeserializer(result.body); +} + +/** This api creates an ispCacheNode with the specified create parameters */ +export function ispCacheNodesOperationsCreateOrUpdate( + context: Client, + subscriptionId: string, + resourceGroupName: string, + customerResourceName: string, + cacheNodeResourceName: string, + resource: IspCacheNodeResource, + options: IspCacheNodesOperationsCreateOrUpdateOptionalParams = { + requestOptions: {}, + }, +): PollerLike, IspCacheNodeResource> { + return getLongRunningPoller( + context, + _ispCacheNodesOperationsCreateOrUpdateDeserialize, + ["200", "201"], + { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _ispCacheNodesOperationsCreateOrUpdateSend( + context, + subscriptionId, + resourceGroupName, + customerResourceName, + cacheNodeResourceName, + resource, + options, + ), + resourceLocationConfig: "azure-async-operation", + }, + ) as PollerLike, IspCacheNodeResource>; +} + +export function _ispCacheNodesOperationsUpdateSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + customerResourceName: string, + cacheNodeResourceName: string, + properties: ConnectedCachePatchResource, + options: IspCacheNodesOperationsUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}/ispCacheNodes/{cacheNodeResourceName}", + subscriptionId, + resourceGroupName, + customerResourceName, + cacheNodeResourceName, + ) + .patch({ + ...operationOptionsToRequestParameters(options), + body: connectedCachePatchResourceSerializer(properties), + }); +} + +export async function _ispCacheNodesOperationsUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + throw createRestError(result); + } + + return ispCacheNodeResourceDeserializer(result.body); +} + +/** This api updates an existing ispCacheNode resource */ +export async function ispCacheNodesOperationsUpdate( + context: Client, + subscriptionId: string, + resourceGroupName: string, + customerResourceName: string, + cacheNodeResourceName: string, + properties: ConnectedCachePatchResource, + options: IspCacheNodesOperationsUpdateOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _ispCacheNodesOperationsUpdateSend( + context, + subscriptionId, + resourceGroupName, + customerResourceName, + cacheNodeResourceName, + properties, + options, + ); + return _ispCacheNodesOperationsUpdateDeserialize(result); +} + +export function _ispCacheNodesOperationsDeleteSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + customerResourceName: string, + cacheNodeResourceName: string, + options: IspCacheNodesOperationsDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}/ispCacheNodes/{cacheNodeResourceName}", + subscriptionId, + resourceGroupName, + customerResourceName, + cacheNodeResourceName, + ) + .delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _ispCacheNodesOperationsDeleteDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["202", "204", "200"]; + if (!expectedStatuses.includes(result.status)) { + throw createRestError(result); + } + + return; +} + +/** This api deletes an existing ispCacheNode resource */ +export function ispCacheNodesOperationsDelete( + context: Client, + subscriptionId: string, + resourceGroupName: string, + customerResourceName: string, + cacheNodeResourceName: string, + options: IspCacheNodesOperationsDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller( + context, + _ispCacheNodesOperationsDeleteDeserialize, + ["202", "204", "200"], + { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _ispCacheNodesOperationsDeleteSend( + context, + subscriptionId, + resourceGroupName, + customerResourceName, + cacheNodeResourceName, + options, + ), + resourceLocationConfig: "location", + }, + ) as PollerLike, void>; +} + +export function _ispCacheNodesOperationsListByIspCustomerResourceSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + customerResourceName: string, + options: IspCacheNodesOperationsListByIspCustomerResourceOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}/ispCacheNodes", + subscriptionId, + resourceGroupName, + customerResourceName, + ) + .get({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _ispCacheNodesOperationsListByIspCustomerResourceDeserialize( + result: PathUncheckedResponse, +): Promise<_IspCacheNodeResourceListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + throw createRestError(result); + } + + return _ispCacheNodeResourceListResultDeserializer(result.body); +} + +/** This api retrieves information about all ispCacheNode resources under the given subscription and resource group */ +export function ispCacheNodesOperationsListByIspCustomerResource( + context: Client, + subscriptionId: string, + resourceGroupName: string, + customerResourceName: string, + options: IspCacheNodesOperationsListByIspCustomerResourceOptionalParams = { + requestOptions: {}, + }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => + _ispCacheNodesOperationsListByIspCustomerResourceSend( + context, + subscriptionId, + resourceGroupName, + customerResourceName, + options, + ), + _ispCacheNodesOperationsListByIspCustomerResourceDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _ispCacheNodesOperationsGetBgpCidrsSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + customerResourceName: string, + cacheNodeResourceName: string, + options: IspCacheNodesOperationsGetBgpCidrsOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}/ispCacheNodes/{cacheNodeResourceName}/getBgpCidrs", + subscriptionId, + resourceGroupName, + customerResourceName, + cacheNodeResourceName, + ) + .post({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _ispCacheNodesOperationsGetBgpCidrsDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + throw createRestError(result); + } + + return mccCacheNodeBgpCidrDetailsDeserializer(result.body); +} + +/** This api gets ispCacheNode resource information */ +export async function ispCacheNodesOperationsGetBgpCidrs( + context: Client, + subscriptionId: string, + resourceGroupName: string, + customerResourceName: string, + cacheNodeResourceName: string, + options: IspCacheNodesOperationsGetBgpCidrsOptionalParams = { + requestOptions: {}, + }, +): Promise { + const result = await _ispCacheNodesOperationsGetBgpCidrsSend( + context, + subscriptionId, + resourceGroupName, + customerResourceName, + cacheNodeResourceName, + options, + ); + return _ispCacheNodesOperationsGetBgpCidrsDeserialize(result); +} + +export function _ispCacheNodesOperationsGetCacheNodeInstallDetailsSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + customerResourceName: string, + cacheNodeResourceName: string, + options: IspCacheNodesOperationsGetCacheNodeInstallDetailsOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}/ispCacheNodes/{cacheNodeResourceName}/getCacheNodeInstallDetails", + subscriptionId, + resourceGroupName, + customerResourceName, + cacheNodeResourceName, + ) + .post({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _ispCacheNodesOperationsGetCacheNodeInstallDetailsDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + throw createRestError(result); + } + + return mccCacheNodeInstallDetailsDeserializer(result.body); +} + +/** This api gets secrets of the ispCacheNode resource install details */ +export async function ispCacheNodesOperationsGetCacheNodeInstallDetails( + context: Client, + subscriptionId: string, + resourceGroupName: string, + customerResourceName: string, + cacheNodeResourceName: string, + options: IspCacheNodesOperationsGetCacheNodeInstallDetailsOptionalParams = { + requestOptions: {}, + }, +): Promise { + const result = await _ispCacheNodesOperationsGetCacheNodeInstallDetailsSend( + context, + subscriptionId, + resourceGroupName, + customerResourceName, + cacheNodeResourceName, + options, + ); + return _ispCacheNodesOperationsGetCacheNodeInstallDetailsDeserialize(result); +} diff --git a/sdk/connectedcache/arm-connectedcache/src/api/ispCustomers/index.ts b/sdk/connectedcache/arm-connectedcache/src/api/ispCustomers/index.ts new file mode 100644 index 00000000000..d1d69d3c6a1 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/src/api/ispCustomers/index.ts @@ -0,0 +1,326 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { + ConnectedCacheContext as Client, + IspCustomersCreateOrUpdateOptionalParams, + IspCustomersDeleteOptionalParams, + IspCustomersGetOptionalParams, + IspCustomersListByResourceGroupOptionalParams, + IspCustomersListBySubscriptionOptionalParams, + IspCustomersUpdateOptionalParams, +} from "../index.js"; +import { + ConnectedCachePatchResource, + connectedCachePatchResourceSerializer, + IspCustomerResource, + ispCustomerResourceSerializer, + ispCustomerResourceDeserializer, + _IspCustomerResourceListResult, + _ispCustomerResourceListResultDeserializer, +} from "../../models/models.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +export function _ispCustomersGetSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + customerResourceName: string, + options: IspCustomersGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}", + subscriptionId, + resourceGroupName, + customerResourceName, + ) + .get({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _ispCustomersGetDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + throw createRestError(result); + } + + return ispCustomerResourceDeserializer(result.body); +} + +/** Gets the ispCustomer resource information using this get call */ +export async function ispCustomersGet( + context: Client, + subscriptionId: string, + resourceGroupName: string, + customerResourceName: string, + options: IspCustomersGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _ispCustomersGetSend( + context, + subscriptionId, + resourceGroupName, + customerResourceName, + options, + ); + return _ispCustomersGetDeserialize(result); +} + +export function _ispCustomersCreateOrUpdateSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + customerResourceName: string, + resource: IspCustomerResource, + options: IspCustomersCreateOrUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}", + subscriptionId, + resourceGroupName, + customerResourceName, + ) + .put({ + ...operationOptionsToRequestParameters(options), + body: ispCustomerResourceSerializer(resource), + }); +} + +export async function _ispCustomersCreateOrUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201"]; + if (!expectedStatuses.includes(result.status)) { + throw createRestError(result); + } + + return ispCustomerResourceDeserializer(result.body); +} + +/** This api creates an ispCustomer with the specified create parameters */ +export function ispCustomersCreateOrUpdate( + context: Client, + subscriptionId: string, + resourceGroupName: string, + customerResourceName: string, + resource: IspCustomerResource, + options: IspCustomersCreateOrUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, IspCustomerResource> { + return getLongRunningPoller(context, _ispCustomersCreateOrUpdateDeserialize, ["200", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _ispCustomersCreateOrUpdateSend( + context, + subscriptionId, + resourceGroupName, + customerResourceName, + resource, + options, + ), + resourceLocationConfig: "azure-async-operation", + }) as PollerLike, IspCustomerResource>; +} + +export function _ispCustomersUpdateSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + customerResourceName: string, + properties: ConnectedCachePatchResource, + options: IspCustomersUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}", + subscriptionId, + resourceGroupName, + customerResourceName, + ) + .patch({ + ...operationOptionsToRequestParameters(options), + body: connectedCachePatchResourceSerializer(properties), + }); +} + +export async function _ispCustomersUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + throw createRestError(result); + } + + return ispCustomerResourceDeserializer(result.body); +} + +/** This api updates an existing ispCustomer resource */ +export async function ispCustomersUpdate( + context: Client, + subscriptionId: string, + resourceGroupName: string, + customerResourceName: string, + properties: ConnectedCachePatchResource, + options: IspCustomersUpdateOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _ispCustomersUpdateSend( + context, + subscriptionId, + resourceGroupName, + customerResourceName, + properties, + options, + ); + return _ispCustomersUpdateDeserialize(result); +} + +export function _ispCustomersDeleteSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + customerResourceName: string, + options: IspCustomersDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}", + subscriptionId, + resourceGroupName, + customerResourceName, + ) + .delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _ispCustomersDeleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "204", "200"]; + if (!expectedStatuses.includes(result.status)) { + throw createRestError(result); + } + + return; +} + +/** This api deletes an existing ispCustomer resource */ +export function ispCustomersDelete( + context: Client, + subscriptionId: string, + resourceGroupName: string, + customerResourceName: string, + options: IspCustomersDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _ispCustomersDeleteDeserialize, ["202", "204", "200"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _ispCustomersDeleteSend( + context, + subscriptionId, + resourceGroupName, + customerResourceName, + options, + ), + resourceLocationConfig: "location", + }) as PollerLike, void>; +} + +export function _ispCustomersListByResourceGroupSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + options: IspCustomersListByResourceGroupOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers", + subscriptionId, + resourceGroupName, + ) + .get({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _ispCustomersListByResourceGroupDeserialize( + result: PathUncheckedResponse, +): Promise<_IspCustomerResourceListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + throw createRestError(result); + } + + return _ispCustomerResourceListResultDeserializer(result.body); +} + +/** This api gets the information about all ispCustomer resources under the given subscription and resource group */ +export function ispCustomersListByResourceGroup( + context: Client, + subscriptionId: string, + resourceGroupName: string, + options: IspCustomersListByResourceGroupOptionalParams = { + requestOptions: {}, + }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _ispCustomersListByResourceGroupSend(context, subscriptionId, resourceGroupName, options), + _ispCustomersListByResourceGroupDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _ispCustomersListBySubscriptionSend( + context: Client, + subscriptionId: string, + options: IspCustomersListBySubscriptionOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + return context + .path( + "/subscriptions/{subscriptionId}/providers/Microsoft.ConnectedCache/ispCustomers", + subscriptionId, + ) + .get({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _ispCustomersListBySubscriptionDeserialize( + result: PathUncheckedResponse, +): Promise<_IspCustomerResourceListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + throw createRestError(result); + } + + return _ispCustomerResourceListResultDeserializer(result.body); +} + +/** This api gets information about all ispCustomer resources under the given subscription */ +export function ispCustomersListBySubscription( + context: Client, + subscriptionId: string, + options: IspCustomersListBySubscriptionOptionalParams = { + requestOptions: {}, + }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _ispCustomersListBySubscriptionSend(context, subscriptionId, options), + _ispCustomersListBySubscriptionDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} diff --git a/sdk/connectedcache/arm-connectedcache/src/api/operations/index.ts b/sdk/connectedcache/arm-connectedcache/src/api/operations/index.ts new file mode 100644 index 00000000000..5236d030b19 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/src/api/operations/index.ts @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheContext as Client, OperationsListOptionalParams } from "../index.js"; +import { + _OperationListResult, + _operationListResultDeserializer, + Operation, +} from "../../models/models.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; + +export function _operationsListSend( + context: Client, + options: OperationsListOptionalParams = { requestOptions: {} }, +): StreamableMethod { + return context + .path("/providers/Microsoft.ConnectedCache/operations") + .get({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _operationsListDeserialize( + result: PathUncheckedResponse, +): Promise<_OperationListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + throw createRestError(result); + } + + return _operationListResultDeserializer(result.body); +} + +/** List the operations for the provider */ +export function operationsList( + context: Client, + options: OperationsListOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _operationsListSend(context, options), + _operationsListDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} diff --git a/sdk/connectedcache/arm-connectedcache/src/api/options.ts b/sdk/connectedcache/arm-connectedcache/src/api/options.ts new file mode 100644 index 00000000000..b2bce9d483c --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/src/api/options.ts @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface OperationsListOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface EnterpriseCustomerOperationsGetOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface EnterpriseCustomerOperationsCreateOrUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface EnterpriseCustomerOperationsUpdateOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface EnterpriseCustomerOperationsDeleteOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface EnterpriseCustomerOperationsListByResourceGroupOptionalParams + extends OperationOptions {} + +/** Optional parameters. */ +export interface EnterpriseCustomerOperationsListBySubscriptionOptionalParams + extends OperationOptions {} + +/** Optional parameters. */ +export interface CacheNodesOperationsGetOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface CacheNodesOperationsCreateorUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface CacheNodesOperationsDeleteOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface CacheNodesOperationsUpdateOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface CacheNodesOperationsListByResourceGroupOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface CacheNodesOperationsListBySubscriptionOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface IspCustomersGetOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface IspCustomersCreateOrUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface IspCustomersUpdateOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface IspCustomersDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface IspCustomersListByResourceGroupOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface IspCustomersListBySubscriptionOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface IspCacheNodesOperationsGetOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface IspCacheNodesOperationsCreateOrUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface IspCacheNodesOperationsUpdateOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface IspCacheNodesOperationsDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface IspCacheNodesOperationsListByIspCustomerResourceOptionalParams + extends OperationOptions {} + +/** Optional parameters. */ +export interface IspCacheNodesOperationsGetBgpCidrsOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface IspCacheNodesOperationsGetCacheNodeInstallDetailsOptionalParams + extends OperationOptions {} + +/** Optional parameters. */ +export interface EnterpriseMccCustomersGetOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface EnterpriseMccCustomersCreateOrUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface EnterpriseMccCustomersUpdateOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface EnterpriseMccCustomersDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface EnterpriseMccCustomersListByResourceGroupOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface EnterpriseMccCustomersListBySubscriptionOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface EnterpriseMccCacheNodesOperationsGetOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface EnterpriseMccCacheNodesOperationsCreateOrUpdateOptionalParams + extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface EnterpriseMccCacheNodesOperationsUpdateOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface EnterpriseMccCacheNodesOperationsDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface EnterpriseMccCacheNodesOperationsListByEnterpriseMccCustomerResourceOptionalParams + extends OperationOptions {} + +/** Optional parameters. */ +export interface EnterpriseMccCacheNodesOperationsGetCacheNodeInstallDetailsOptionalParams + extends OperationOptions {} diff --git a/sdk/connectedcache/arm-connectedcache/src/classic/cacheNodesOperations/index.ts b/sdk/connectedcache/arm-connectedcache/src/classic/cacheNodesOperations/index.ts new file mode 100644 index 00000000000..c67f07f6161 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/src/classic/cacheNodesOperations/index.ts @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheContext } from "../../api/connectedCacheContext.js"; +import { + cacheNodesOperationsGet, + cacheNodesOperationsCreateorUpdate, + cacheNodesOperationsDelete, + cacheNodesOperationsUpdate, + cacheNodesOperationsListByResourceGroup, + cacheNodesOperationsListBySubscription, +} from "../../api/cacheNodesOperations/index.js"; +import { ConnectedCachePatchResource, CacheNodePreviewResource } from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { PollerLike, OperationState } from "@azure/core-lro"; +import { + CacheNodesOperationsGetOptionalParams, + CacheNodesOperationsCreateorUpdateOptionalParams, + CacheNodesOperationsDeleteOptionalParams, + CacheNodesOperationsUpdateOptionalParams, + CacheNodesOperationsListByResourceGroupOptionalParams, + CacheNodesOperationsListBySubscriptionOptionalParams, +} from "../../api/options.js"; + +/** Interface representing a CacheNodesOperations operations. */ +export interface CacheNodesOperationsOperations { + /** Retrieves the properties of a cacheNodes */ + get: ( + resourceGroupName: string, + customerResourceName: string, + options?: CacheNodesOperationsGetOptionalParams, + ) => Promise; + /** Creates a cacheNodes with the specified create parameters */ + createorUpdate: ( + resourceGroupName: string, + customerResourceName: string, + resource: CacheNodePreviewResource, + options?: CacheNodesOperationsCreateorUpdateOptionalParams, + ) => PollerLike, CacheNodePreviewResource>; + /** Deletes an existing cache Node */ + delete: ( + resourceGroupName: string, + customerResourceName: string, + options?: CacheNodesOperationsDeleteOptionalParams, + ) => Promise; + /** updates an existing Cache Node */ + update: ( + resourceGroupName: string, + customerResourceName: string, + properties: ConnectedCachePatchResource, + options?: CacheNodesOperationsUpdateOptionalParams, + ) => Promise; + /** Retrieves the properties of all ConnectedCache */ + listByResourceGroup: ( + resourceGroupName: string, + options?: CacheNodesOperationsListByResourceGroupOptionalParams, + ) => PagedAsyncIterableIterator; + /** Retrieves the properties of all ConnectedCaches */ + listBySubscription: ( + options?: CacheNodesOperationsListBySubscriptionOptionalParams, + ) => PagedAsyncIterableIterator; +} + +export function getCacheNodesOperations(context: ConnectedCacheContext, subscriptionId: string) { + return { + get: ( + resourceGroupName: string, + customerResourceName: string, + options?: CacheNodesOperationsGetOptionalParams, + ) => + cacheNodesOperationsGet( + context, + subscriptionId, + resourceGroupName, + customerResourceName, + options, + ), + createorUpdate: ( + resourceGroupName: string, + customerResourceName: string, + resource: CacheNodePreviewResource, + options?: CacheNodesOperationsCreateorUpdateOptionalParams, + ) => + cacheNodesOperationsCreateorUpdate( + context, + subscriptionId, + resourceGroupName, + customerResourceName, + resource, + options, + ), + delete: ( + resourceGroupName: string, + customerResourceName: string, + options?: CacheNodesOperationsDeleteOptionalParams, + ) => + cacheNodesOperationsDelete( + context, + subscriptionId, + resourceGroupName, + customerResourceName, + options, + ), + update: ( + resourceGroupName: string, + customerResourceName: string, + properties: ConnectedCachePatchResource, + options?: CacheNodesOperationsUpdateOptionalParams, + ) => + cacheNodesOperationsUpdate( + context, + subscriptionId, + resourceGroupName, + customerResourceName, + properties, + options, + ), + listByResourceGroup: ( + resourceGroupName: string, + options?: CacheNodesOperationsListByResourceGroupOptionalParams, + ) => + cacheNodesOperationsListByResourceGroup(context, subscriptionId, resourceGroupName, options), + listBySubscription: (options?: CacheNodesOperationsListBySubscriptionOptionalParams) => + cacheNodesOperationsListBySubscription(context, subscriptionId, options), + }; +} + +export function getCacheNodesOperationsOperations( + context: ConnectedCacheContext, + subscriptionId: string, +): CacheNodesOperationsOperations { + return { + ...getCacheNodesOperations(context, subscriptionId), + }; +} diff --git a/sdk/connectedcache/arm-connectedcache/src/classic/enterpriseCustomerOperations/index.ts b/sdk/connectedcache/arm-connectedcache/src/classic/enterpriseCustomerOperations/index.ts new file mode 100644 index 00000000000..66d6c892891 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/src/classic/enterpriseCustomerOperations/index.ts @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheContext } from "../../api/connectedCacheContext.js"; +import { + enterpriseCustomerOperationsGet, + enterpriseCustomerOperationsCreateOrUpdate, + enterpriseCustomerOperationsUpdate, + enterpriseCustomerOperationsDelete, + enterpriseCustomerOperationsListByResourceGroup, + enterpriseCustomerOperationsListBySubscription, +} from "../../api/enterpriseCustomerOperations/index.js"; +import { + EnterpriseCustomerOperationsGetOptionalParams, + EnterpriseCustomerOperationsCreateOrUpdateOptionalParams, + EnterpriseCustomerOperationsUpdateOptionalParams, + EnterpriseCustomerOperationsDeleteOptionalParams, + EnterpriseCustomerOperationsListByResourceGroupOptionalParams, + EnterpriseCustomerOperationsListBySubscriptionOptionalParams, +} from "../../api/options.js"; +import { ConnectedCachePatchResource, EnterprisePreviewResource } from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a EnterpriseCustomerOperations operations. */ +export interface EnterpriseCustomerOperationsOperations { + /** Retrieves the properties of a Enterprise customer */ + get: ( + resourceGroupName: string, + customerResourceName: string, + options?: EnterpriseCustomerOperationsGetOptionalParams, + ) => Promise; + /** Creates a cacheNodes with the specified create parameters */ + createOrUpdate: ( + resourceGroupName: string, + customerResourceName: string, + resource: EnterprisePreviewResource, + options?: EnterpriseCustomerOperationsCreateOrUpdateOptionalParams, + ) => PollerLike, EnterprisePreviewResource>; + /** updates an existing enterpriseCustomers */ + update: ( + resourceGroupName: string, + customerResourceName: string, + properties: ConnectedCachePatchResource, + options?: EnterpriseCustomerOperationsUpdateOptionalParams, + ) => Promise; + /** Deletes an existing customer Enterprise resource */ + delete: ( + resourceGroupName: string, + customerResourceName: string, + options?: EnterpriseCustomerOperationsDeleteOptionalParams, + ) => Promise; + /** Retrieves the properties of all ConnectedCache enterpriseCustomers */ + listByResourceGroup: ( + resourceGroupName: string, + options?: EnterpriseCustomerOperationsListByResourceGroupOptionalParams, + ) => PagedAsyncIterableIterator; + /** Retrieves the properties of all ConnectedCaches */ + listBySubscription: ( + options?: EnterpriseCustomerOperationsListBySubscriptionOptionalParams, + ) => PagedAsyncIterableIterator; +} + +export function getEnterpriseCustomerOperations( + context: ConnectedCacheContext, + subscriptionId: string, +) { + return { + get: ( + resourceGroupName: string, + customerResourceName: string, + options?: EnterpriseCustomerOperationsGetOptionalParams, + ) => + enterpriseCustomerOperationsGet( + context, + subscriptionId, + resourceGroupName, + customerResourceName, + options, + ), + createOrUpdate: ( + resourceGroupName: string, + customerResourceName: string, + resource: EnterprisePreviewResource, + options?: EnterpriseCustomerOperationsCreateOrUpdateOptionalParams, + ) => + enterpriseCustomerOperationsCreateOrUpdate( + context, + subscriptionId, + resourceGroupName, + customerResourceName, + resource, + options, + ), + update: ( + resourceGroupName: string, + customerResourceName: string, + properties: ConnectedCachePatchResource, + options?: EnterpriseCustomerOperationsUpdateOptionalParams, + ) => + enterpriseCustomerOperationsUpdate( + context, + subscriptionId, + resourceGroupName, + customerResourceName, + properties, + options, + ), + delete: ( + resourceGroupName: string, + customerResourceName: string, + options?: EnterpriseCustomerOperationsDeleteOptionalParams, + ) => + enterpriseCustomerOperationsDelete( + context, + subscriptionId, + resourceGroupName, + customerResourceName, + options, + ), + listByResourceGroup: ( + resourceGroupName: string, + options?: EnterpriseCustomerOperationsListByResourceGroupOptionalParams, + ) => + enterpriseCustomerOperationsListByResourceGroup( + context, + subscriptionId, + resourceGroupName, + options, + ), + listBySubscription: (options?: EnterpriseCustomerOperationsListBySubscriptionOptionalParams) => + enterpriseCustomerOperationsListBySubscription(context, subscriptionId, options), + }; +} + +export function getEnterpriseCustomerOperationsOperations( + context: ConnectedCacheContext, + subscriptionId: string, +): EnterpriseCustomerOperationsOperations { + return { + ...getEnterpriseCustomerOperations(context, subscriptionId), + }; +} diff --git a/sdk/connectedcache/arm-connectedcache/src/classic/enterpriseMccCacheNodesOperations/index.ts b/sdk/connectedcache/arm-connectedcache/src/classic/enterpriseMccCacheNodesOperations/index.ts new file mode 100644 index 00000000000..f148cf69edf --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/src/classic/enterpriseMccCacheNodesOperations/index.ts @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheContext } from "../../api/connectedCacheContext.js"; +import { + enterpriseMccCacheNodesOperationsGet, + enterpriseMccCacheNodesOperationsCreateOrUpdate, + enterpriseMccCacheNodesOperationsUpdate, + enterpriseMccCacheNodesOperationsDelete, + enterpriseMccCacheNodesOperationsListByEnterpriseMccCustomerResource, + enterpriseMccCacheNodesOperationsGetCacheNodeInstallDetails, +} from "../../api/enterpriseMccCacheNodesOperations/index.js"; +import { + EnterpriseMccCacheNodesOperationsGetOptionalParams, + EnterpriseMccCacheNodesOperationsCreateOrUpdateOptionalParams, + EnterpriseMccCacheNodesOperationsUpdateOptionalParams, + EnterpriseMccCacheNodesOperationsDeleteOptionalParams, + EnterpriseMccCacheNodesOperationsListByEnterpriseMccCustomerResourceOptionalParams, + EnterpriseMccCacheNodesOperationsGetCacheNodeInstallDetailsOptionalParams, +} from "../../api/options.js"; +import { + EnterpriseMccCacheNodeResource, + ConnectedCachePatchResource, + MccCacheNodeInstallDetails, +} from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a EnterpriseMccCacheNodesOperations operations. */ +export interface EnterpriseMccCacheNodesOperationsOperations { + /** This api gets ispCacheNode resource information */ + get: ( + resourceGroupName: string, + customerResourceName: string, + cacheNodeResourceName: string, + options?: EnterpriseMccCacheNodesOperationsGetOptionalParams, + ) => Promise; + /** This api creates an ispCacheNode with the specified create parameters */ + createOrUpdate: ( + resourceGroupName: string, + customerResourceName: string, + cacheNodeResourceName: string, + resource: EnterpriseMccCacheNodeResource, + options?: EnterpriseMccCacheNodesOperationsCreateOrUpdateOptionalParams, + ) => PollerLike, EnterpriseMccCacheNodeResource>; + /** This api updates an existing ispCacheNode resource */ + update: ( + resourceGroupName: string, + customerResourceName: string, + cacheNodeResourceName: string, + properties: ConnectedCachePatchResource, + options?: EnterpriseMccCacheNodesOperationsUpdateOptionalParams, + ) => Promise; + /** This api deletes an existing ispCacheNode resource */ + delete: ( + resourceGroupName: string, + customerResourceName: string, + cacheNodeResourceName: string, + options?: EnterpriseMccCacheNodesOperationsDeleteOptionalParams, + ) => PollerLike, void>; + /** This api retrieves information about all ispCacheNode resources under the given subscription and resource group */ + listByEnterpriseMccCustomerResource: ( + resourceGroupName: string, + customerResourceName: string, + options?: EnterpriseMccCacheNodesOperationsListByEnterpriseMccCustomerResourceOptionalParams, + ) => PagedAsyncIterableIterator; + /** This api gets secrets of the ispCacheNode resource install details */ + getCacheNodeInstallDetails: ( + resourceGroupName: string, + customerResourceName: string, + cacheNodeResourceName: string, + options?: EnterpriseMccCacheNodesOperationsGetCacheNodeInstallDetailsOptionalParams, + ) => Promise; +} + +export function getEnterpriseMccCacheNodesOperations( + context: ConnectedCacheContext, + subscriptionId: string, +) { + return { + get: ( + resourceGroupName: string, + customerResourceName: string, + cacheNodeResourceName: string, + options?: EnterpriseMccCacheNodesOperationsGetOptionalParams, + ) => + enterpriseMccCacheNodesOperationsGet( + context, + subscriptionId, + resourceGroupName, + customerResourceName, + cacheNodeResourceName, + options, + ), + createOrUpdate: ( + resourceGroupName: string, + customerResourceName: string, + cacheNodeResourceName: string, + resource: EnterpriseMccCacheNodeResource, + options?: EnterpriseMccCacheNodesOperationsCreateOrUpdateOptionalParams, + ) => + enterpriseMccCacheNodesOperationsCreateOrUpdate( + context, + subscriptionId, + resourceGroupName, + customerResourceName, + cacheNodeResourceName, + resource, + options, + ), + update: ( + resourceGroupName: string, + customerResourceName: string, + cacheNodeResourceName: string, + properties: ConnectedCachePatchResource, + options?: EnterpriseMccCacheNodesOperationsUpdateOptionalParams, + ) => + enterpriseMccCacheNodesOperationsUpdate( + context, + subscriptionId, + resourceGroupName, + customerResourceName, + cacheNodeResourceName, + properties, + options, + ), + delete: ( + resourceGroupName: string, + customerResourceName: string, + cacheNodeResourceName: string, + options?: EnterpriseMccCacheNodesOperationsDeleteOptionalParams, + ) => + enterpriseMccCacheNodesOperationsDelete( + context, + subscriptionId, + resourceGroupName, + customerResourceName, + cacheNodeResourceName, + options, + ), + listByEnterpriseMccCustomerResource: ( + resourceGroupName: string, + customerResourceName: string, + options?: EnterpriseMccCacheNodesOperationsListByEnterpriseMccCustomerResourceOptionalParams, + ) => + enterpriseMccCacheNodesOperationsListByEnterpriseMccCustomerResource( + context, + subscriptionId, + resourceGroupName, + customerResourceName, + options, + ), + getCacheNodeInstallDetails: ( + resourceGroupName: string, + customerResourceName: string, + cacheNodeResourceName: string, + options?: EnterpriseMccCacheNodesOperationsGetCacheNodeInstallDetailsOptionalParams, + ) => + enterpriseMccCacheNodesOperationsGetCacheNodeInstallDetails( + context, + subscriptionId, + resourceGroupName, + customerResourceName, + cacheNodeResourceName, + options, + ), + }; +} + +export function getEnterpriseMccCacheNodesOperationsOperations( + context: ConnectedCacheContext, + subscriptionId: string, +): EnterpriseMccCacheNodesOperationsOperations { + return { + ...getEnterpriseMccCacheNodesOperations(context, subscriptionId), + }; +} diff --git a/sdk/connectedcache/arm-connectedcache/src/classic/enterpriseMccCustomers/index.ts b/sdk/connectedcache/arm-connectedcache/src/classic/enterpriseMccCustomers/index.ts new file mode 100644 index 00000000000..dca70f70e1d --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/src/classic/enterpriseMccCustomers/index.ts @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheContext } from "../../api/connectedCacheContext.js"; +import { + enterpriseMccCustomersGet, + enterpriseMccCustomersCreateOrUpdate, + enterpriseMccCustomersUpdate, + enterpriseMccCustomersDelete, + enterpriseMccCustomersListByResourceGroup, + enterpriseMccCustomersListBySubscription, +} from "../../api/enterpriseMccCustomers/index.js"; +import { + EnterpriseMccCustomersGetOptionalParams, + EnterpriseMccCustomersCreateOrUpdateOptionalParams, + EnterpriseMccCustomersUpdateOptionalParams, + EnterpriseMccCustomersDeleteOptionalParams, + EnterpriseMccCustomersListByResourceGroupOptionalParams, + EnterpriseMccCustomersListBySubscriptionOptionalParams, +} from "../../api/options.js"; +import { ConnectedCachePatchResource, EnterpriseMccCustomerResource } from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a EnterpriseMccCustomers operations. */ +export interface EnterpriseMccCustomersOperations { + /** Gets the enterprise mcc customer resource information using this get call */ + get: ( + resourceGroupName: string, + customerResourceName: string, + options?: EnterpriseMccCustomersGetOptionalParams, + ) => Promise; + /** This api creates an enterprise mcc customer with the specified create parameters */ + createOrUpdate: ( + resourceGroupName: string, + customerResourceName: string, + resource: EnterpriseMccCustomerResource, + options?: EnterpriseMccCustomersCreateOrUpdateOptionalParams, + ) => PollerLike, EnterpriseMccCustomerResource>; + /** This api updates an existing enterprise mcc customer resource */ + update: ( + resourceGroupName: string, + customerResourceName: string, + properties: ConnectedCachePatchResource, + options?: EnterpriseMccCustomersUpdateOptionalParams, + ) => Promise; + /** This api deletes an existing enterprise mcc customer resource */ + delete: ( + resourceGroupName: string, + customerResourceName: string, + options?: EnterpriseMccCustomersDeleteOptionalParams, + ) => PollerLike, void>; + /** This api gets the information about all enterprise mcc customer resources under the given subscription and resource group */ + listByResourceGroup: ( + resourceGroupName: string, + options?: EnterpriseMccCustomersListByResourceGroupOptionalParams, + ) => PagedAsyncIterableIterator; + /** This api gets information about all enterpriseMccCustomer resources under the given subscription */ + listBySubscription: ( + options?: EnterpriseMccCustomersListBySubscriptionOptionalParams, + ) => PagedAsyncIterableIterator; +} + +export function getEnterpriseMccCustomers(context: ConnectedCacheContext, subscriptionId: string) { + return { + get: ( + resourceGroupName: string, + customerResourceName: string, + options?: EnterpriseMccCustomersGetOptionalParams, + ) => + enterpriseMccCustomersGet( + context, + subscriptionId, + resourceGroupName, + customerResourceName, + options, + ), + createOrUpdate: ( + resourceGroupName: string, + customerResourceName: string, + resource: EnterpriseMccCustomerResource, + options?: EnterpriseMccCustomersCreateOrUpdateOptionalParams, + ) => + enterpriseMccCustomersCreateOrUpdate( + context, + subscriptionId, + resourceGroupName, + customerResourceName, + resource, + options, + ), + update: ( + resourceGroupName: string, + customerResourceName: string, + properties: ConnectedCachePatchResource, + options?: EnterpriseMccCustomersUpdateOptionalParams, + ) => + enterpriseMccCustomersUpdate( + context, + subscriptionId, + resourceGroupName, + customerResourceName, + properties, + options, + ), + delete: ( + resourceGroupName: string, + customerResourceName: string, + options?: EnterpriseMccCustomersDeleteOptionalParams, + ) => + enterpriseMccCustomersDelete( + context, + subscriptionId, + resourceGroupName, + customerResourceName, + options, + ), + listByResourceGroup: ( + resourceGroupName: string, + options?: EnterpriseMccCustomersListByResourceGroupOptionalParams, + ) => + enterpriseMccCustomersListByResourceGroup( + context, + subscriptionId, + resourceGroupName, + options, + ), + listBySubscription: (options?: EnterpriseMccCustomersListBySubscriptionOptionalParams) => + enterpriseMccCustomersListBySubscription(context, subscriptionId, options), + }; +} + +export function getEnterpriseMccCustomersOperations( + context: ConnectedCacheContext, + subscriptionId: string, +): EnterpriseMccCustomersOperations { + return { + ...getEnterpriseMccCustomers(context, subscriptionId), + }; +} diff --git a/sdk/connectedcache/arm-connectedcache/src/classic/index.ts b/sdk/connectedcache/arm-connectedcache/src/classic/index.ts new file mode 100644 index 00000000000..3b57ed34114 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/src/classic/index.ts @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { CacheNodesOperationsOperations } from "./cacheNodesOperations/index.js"; +export { EnterpriseCustomerOperationsOperations } from "./enterpriseCustomerOperations/index.js"; +export { EnterpriseMccCacheNodesOperationsOperations } from "./enterpriseMccCacheNodesOperations/index.js"; +export { EnterpriseMccCustomersOperations } from "./enterpriseMccCustomers/index.js"; +export { IspCacheNodesOperationsOperations } from "./ispCacheNodesOperations/index.js"; +export { IspCustomersOperations } from "./ispCustomers/index.js"; +export { OperationsOperations } from "./operations/index.js"; diff --git a/sdk/connectedcache/arm-connectedcache/src/classic/ispCacheNodesOperations/index.ts b/sdk/connectedcache/arm-connectedcache/src/classic/ispCacheNodesOperations/index.ts new file mode 100644 index 00000000000..99cc2cb6742 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/src/classic/ispCacheNodesOperations/index.ts @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheContext } from "../../api/connectedCacheContext.js"; +import { + ispCacheNodesOperationsGet, + ispCacheNodesOperationsCreateOrUpdate, + ispCacheNodesOperationsUpdate, + ispCacheNodesOperationsDelete, + ispCacheNodesOperationsListByIspCustomerResource, + ispCacheNodesOperationsGetBgpCidrs, + ispCacheNodesOperationsGetCacheNodeInstallDetails, +} from "../../api/ispCacheNodesOperations/index.js"; +import { + IspCacheNodesOperationsGetOptionalParams, + IspCacheNodesOperationsCreateOrUpdateOptionalParams, + IspCacheNodesOperationsUpdateOptionalParams, + IspCacheNodesOperationsDeleteOptionalParams, + IspCacheNodesOperationsListByIspCustomerResourceOptionalParams, + IspCacheNodesOperationsGetBgpCidrsOptionalParams, + IspCacheNodesOperationsGetCacheNodeInstallDetailsOptionalParams, +} from "../../api/options.js"; +import { + ConnectedCachePatchResource, + MccCacheNodeInstallDetails, + IspCacheNodeResource, + MccCacheNodeBgpCidrDetails, +} from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a IspCacheNodesOperations operations. */ +export interface IspCacheNodesOperationsOperations { + /** This api gets ispCacheNode resource information */ + get: ( + resourceGroupName: string, + customerResourceName: string, + cacheNodeResourceName: string, + options?: IspCacheNodesOperationsGetOptionalParams, + ) => Promise; + /** This api creates an ispCacheNode with the specified create parameters */ + createOrUpdate: ( + resourceGroupName: string, + customerResourceName: string, + cacheNodeResourceName: string, + resource: IspCacheNodeResource, + options?: IspCacheNodesOperationsCreateOrUpdateOptionalParams, + ) => PollerLike, IspCacheNodeResource>; + /** This api updates an existing ispCacheNode resource */ + update: ( + resourceGroupName: string, + customerResourceName: string, + cacheNodeResourceName: string, + properties: ConnectedCachePatchResource, + options?: IspCacheNodesOperationsUpdateOptionalParams, + ) => Promise; + /** This api deletes an existing ispCacheNode resource */ + delete: ( + resourceGroupName: string, + customerResourceName: string, + cacheNodeResourceName: string, + options?: IspCacheNodesOperationsDeleteOptionalParams, + ) => PollerLike, void>; + /** This api retrieves information about all ispCacheNode resources under the given subscription and resource group */ + listByIspCustomerResource: ( + resourceGroupName: string, + customerResourceName: string, + options?: IspCacheNodesOperationsListByIspCustomerResourceOptionalParams, + ) => PagedAsyncIterableIterator; + /** This api gets ispCacheNode resource information */ + getBgpCidrs: ( + resourceGroupName: string, + customerResourceName: string, + cacheNodeResourceName: string, + options?: IspCacheNodesOperationsGetBgpCidrsOptionalParams, + ) => Promise; + /** This api gets secrets of the ispCacheNode resource install details */ + getCacheNodeInstallDetails: ( + resourceGroupName: string, + customerResourceName: string, + cacheNodeResourceName: string, + options?: IspCacheNodesOperationsGetCacheNodeInstallDetailsOptionalParams, + ) => Promise; +} + +export function getIspCacheNodesOperations(context: ConnectedCacheContext, subscriptionId: string) { + return { + get: ( + resourceGroupName: string, + customerResourceName: string, + cacheNodeResourceName: string, + options?: IspCacheNodesOperationsGetOptionalParams, + ) => + ispCacheNodesOperationsGet( + context, + subscriptionId, + resourceGroupName, + customerResourceName, + cacheNodeResourceName, + options, + ), + createOrUpdate: ( + resourceGroupName: string, + customerResourceName: string, + cacheNodeResourceName: string, + resource: IspCacheNodeResource, + options?: IspCacheNodesOperationsCreateOrUpdateOptionalParams, + ) => + ispCacheNodesOperationsCreateOrUpdate( + context, + subscriptionId, + resourceGroupName, + customerResourceName, + cacheNodeResourceName, + resource, + options, + ), + update: ( + resourceGroupName: string, + customerResourceName: string, + cacheNodeResourceName: string, + properties: ConnectedCachePatchResource, + options?: IspCacheNodesOperationsUpdateOptionalParams, + ) => + ispCacheNodesOperationsUpdate( + context, + subscriptionId, + resourceGroupName, + customerResourceName, + cacheNodeResourceName, + properties, + options, + ), + delete: ( + resourceGroupName: string, + customerResourceName: string, + cacheNodeResourceName: string, + options?: IspCacheNodesOperationsDeleteOptionalParams, + ) => + ispCacheNodesOperationsDelete( + context, + subscriptionId, + resourceGroupName, + customerResourceName, + cacheNodeResourceName, + options, + ), + listByIspCustomerResource: ( + resourceGroupName: string, + customerResourceName: string, + options?: IspCacheNodesOperationsListByIspCustomerResourceOptionalParams, + ) => + ispCacheNodesOperationsListByIspCustomerResource( + context, + subscriptionId, + resourceGroupName, + customerResourceName, + options, + ), + getBgpCidrs: ( + resourceGroupName: string, + customerResourceName: string, + cacheNodeResourceName: string, + options?: IspCacheNodesOperationsGetBgpCidrsOptionalParams, + ) => + ispCacheNodesOperationsGetBgpCidrs( + context, + subscriptionId, + resourceGroupName, + customerResourceName, + cacheNodeResourceName, + options, + ), + getCacheNodeInstallDetails: ( + resourceGroupName: string, + customerResourceName: string, + cacheNodeResourceName: string, + options?: IspCacheNodesOperationsGetCacheNodeInstallDetailsOptionalParams, + ) => + ispCacheNodesOperationsGetCacheNodeInstallDetails( + context, + subscriptionId, + resourceGroupName, + customerResourceName, + cacheNodeResourceName, + options, + ), + }; +} + +export function getIspCacheNodesOperationsOperations( + context: ConnectedCacheContext, + subscriptionId: string, +): IspCacheNodesOperationsOperations { + return { + ...getIspCacheNodesOperations(context, subscriptionId), + }; +} diff --git a/sdk/connectedcache/arm-connectedcache/src/classic/ispCustomers/index.ts b/sdk/connectedcache/arm-connectedcache/src/classic/ispCustomers/index.ts new file mode 100644 index 00000000000..65943d9a831 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/src/classic/ispCustomers/index.ts @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheContext } from "../../api/connectedCacheContext.js"; +import { + ispCustomersGet, + ispCustomersCreateOrUpdate, + ispCustomersUpdate, + ispCustomersDelete, + ispCustomersListByResourceGroup, + ispCustomersListBySubscription, +} from "../../api/ispCustomers/index.js"; +import { + IspCustomersGetOptionalParams, + IspCustomersCreateOrUpdateOptionalParams, + IspCustomersUpdateOptionalParams, + IspCustomersDeleteOptionalParams, + IspCustomersListByResourceGroupOptionalParams, + IspCustomersListBySubscriptionOptionalParams, +} from "../../api/options.js"; +import { ConnectedCachePatchResource, IspCustomerResource } from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a IspCustomers operations. */ +export interface IspCustomersOperations { + /** Gets the ispCustomer resource information using this get call */ + get: ( + resourceGroupName: string, + customerResourceName: string, + options?: IspCustomersGetOptionalParams, + ) => Promise; + /** This api creates an ispCustomer with the specified create parameters */ + createOrUpdate: ( + resourceGroupName: string, + customerResourceName: string, + resource: IspCustomerResource, + options?: IspCustomersCreateOrUpdateOptionalParams, + ) => PollerLike, IspCustomerResource>; + /** This api updates an existing ispCustomer resource */ + update: ( + resourceGroupName: string, + customerResourceName: string, + properties: ConnectedCachePatchResource, + options?: IspCustomersUpdateOptionalParams, + ) => Promise; + /** This api deletes an existing ispCustomer resource */ + delete: ( + resourceGroupName: string, + customerResourceName: string, + options?: IspCustomersDeleteOptionalParams, + ) => PollerLike, void>; + /** This api gets the information about all ispCustomer resources under the given subscription and resource group */ + listByResourceGroup: ( + resourceGroupName: string, + options?: IspCustomersListByResourceGroupOptionalParams, + ) => PagedAsyncIterableIterator; + /** This api gets information about all ispCustomer resources under the given subscription */ + listBySubscription: ( + options?: IspCustomersListBySubscriptionOptionalParams, + ) => PagedAsyncIterableIterator; +} + +export function getIspCustomers(context: ConnectedCacheContext, subscriptionId: string) { + return { + get: ( + resourceGroupName: string, + customerResourceName: string, + options?: IspCustomersGetOptionalParams, + ) => ispCustomersGet(context, subscriptionId, resourceGroupName, customerResourceName, options), + createOrUpdate: ( + resourceGroupName: string, + customerResourceName: string, + resource: IspCustomerResource, + options?: IspCustomersCreateOrUpdateOptionalParams, + ) => + ispCustomersCreateOrUpdate( + context, + subscriptionId, + resourceGroupName, + customerResourceName, + resource, + options, + ), + update: ( + resourceGroupName: string, + customerResourceName: string, + properties: ConnectedCachePatchResource, + options?: IspCustomersUpdateOptionalParams, + ) => + ispCustomersUpdate( + context, + subscriptionId, + resourceGroupName, + customerResourceName, + properties, + options, + ), + delete: ( + resourceGroupName: string, + customerResourceName: string, + options?: IspCustomersDeleteOptionalParams, + ) => + ispCustomersDelete(context, subscriptionId, resourceGroupName, customerResourceName, options), + listByResourceGroup: ( + resourceGroupName: string, + options?: IspCustomersListByResourceGroupOptionalParams, + ) => ispCustomersListByResourceGroup(context, subscriptionId, resourceGroupName, options), + listBySubscription: (options?: IspCustomersListBySubscriptionOptionalParams) => + ispCustomersListBySubscription(context, subscriptionId, options), + }; +} + +export function getIspCustomersOperations( + context: ConnectedCacheContext, + subscriptionId: string, +): IspCustomersOperations { + return { + ...getIspCustomers(context, subscriptionId), + }; +} diff --git a/sdk/connectedcache/arm-connectedcache/src/classic/operations/index.ts b/sdk/connectedcache/arm-connectedcache/src/classic/operations/index.ts new file mode 100644 index 00000000000..386932db432 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/src/classic/operations/index.ts @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheContext } from "../../api/connectedCacheContext.js"; +import { operationsList } from "../../api/operations/index.js"; +import { OperationsListOptionalParams } from "../../api/options.js"; +import { Operation } from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; + +/** Interface representing a Operations operations. */ +export interface OperationsOperations { + /** List the operations for the provider */ + list: (options?: OperationsListOptionalParams) => PagedAsyncIterableIterator; +} + +export function getOperations(context: ConnectedCacheContext) { + return { + list: (options?: OperationsListOptionalParams) => operationsList(context, options), + }; +} + +export function getOperationsOperations(context: ConnectedCacheContext): OperationsOperations { + return { + ...getOperations(context), + }; +} diff --git a/sdk/connectedcache/arm-connectedcache/src/connectedCacheClient.ts b/sdk/connectedcache/arm-connectedcache/src/connectedCacheClient.ts new file mode 100644 index 00000000000..e83c6f97a7b --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/src/connectedCacheClient.ts @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { getOperationsOperations, OperationsOperations } from "./classic/operations/index.js"; +import { + getEnterpriseCustomerOperationsOperations, + EnterpriseCustomerOperationsOperations, +} from "./classic/enterpriseCustomerOperations/index.js"; +import { + getCacheNodesOperationsOperations, + CacheNodesOperationsOperations, +} from "./classic/cacheNodesOperations/index.js"; +import { getIspCustomersOperations, IspCustomersOperations } from "./classic/ispCustomers/index.js"; +import { + getIspCacheNodesOperationsOperations, + IspCacheNodesOperationsOperations, +} from "./classic/ispCacheNodesOperations/index.js"; +import { + getEnterpriseMccCustomersOperations, + EnterpriseMccCustomersOperations, +} from "./classic/enterpriseMccCustomers/index.js"; +import { + getEnterpriseMccCacheNodesOperationsOperations, + EnterpriseMccCacheNodesOperationsOperations, +} from "./classic/enterpriseMccCacheNodesOperations/index.js"; +import { + createConnectedCache, + ConnectedCacheContext, + ConnectedCacheClientOptionalParams, +} from "./api/index.js"; +import { Pipeline } from "@azure/core-rest-pipeline"; +import { TokenCredential } from "@azure/core-auth"; + +export { ConnectedCacheClientOptionalParams } from "./api/connectedCacheContext.js"; + +export class ConnectedCacheClient { + private _client: ConnectedCacheContext; + /** The pipeline used by this client to make requests */ + public readonly pipeline: Pipeline; + + /** Microsoft Connected Cache Rest Api version 2023-05-01-preview */ + constructor( + credential: TokenCredential, + subscriptionId: string, + options: ConnectedCacheClientOptionalParams = {}, + ) { + const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix; + const userAgentPrefix = prefixFromOptions + ? `${prefixFromOptions} azsdk-js-client` + : `azsdk-js-client`; + this._client = createConnectedCache(credential, { + ...options, + userAgentOptions: { userAgentPrefix }, + }); + this.pipeline = this._client.pipeline; + this.operations = getOperationsOperations(this._client); + this.enterpriseCustomerOperations = getEnterpriseCustomerOperationsOperations( + this._client, + subscriptionId, + ); + this.cacheNodesOperations = getCacheNodesOperationsOperations(this._client, subscriptionId); + this.ispCustomers = getIspCustomersOperations(this._client, subscriptionId); + this.ispCacheNodesOperations = getIspCacheNodesOperationsOperations( + this._client, + subscriptionId, + ); + this.enterpriseMccCustomers = getEnterpriseMccCustomersOperations(this._client, subscriptionId); + this.enterpriseMccCacheNodesOperations = getEnterpriseMccCacheNodesOperationsOperations( + this._client, + subscriptionId, + ); + } + + /** The operation groups for Operations */ + public readonly operations: OperationsOperations; + /** The operation groups for EnterpriseCustomerOperations */ + public readonly enterpriseCustomerOperations: EnterpriseCustomerOperationsOperations; + /** The operation groups for CacheNodesOperations */ + public readonly cacheNodesOperations: CacheNodesOperationsOperations; + /** The operation groups for IspCustomers */ + public readonly ispCustomers: IspCustomersOperations; + /** The operation groups for IspCacheNodesOperations */ + public readonly ispCacheNodesOperations: IspCacheNodesOperationsOperations; + /** The operation groups for EnterpriseMccCustomers */ + public readonly enterpriseMccCustomers: EnterpriseMccCustomersOperations; + /** The operation groups for EnterpriseMccCacheNodesOperations */ + public readonly enterpriseMccCacheNodesOperations: EnterpriseMccCacheNodesOperationsOperations; +} diff --git a/sdk/connectedcache/arm-connectedcache/src/helpers/serializerHelpers.ts b/sdk/connectedcache/arm-connectedcache/src/helpers/serializerHelpers.ts new file mode 100644 index 00000000000..7518a16c2ee --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/src/helpers/serializerHelpers.ts @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export function serializeRecord( + item: Record, +): Record; +export function serializeRecord( + item: Record, + serializer: (item: T) => R, +): Record; +export function serializeRecord( + item: Record, + serializer?: (item: T) => R, +): Record { + return Object.keys(item).reduce( + (acc, key) => { + if (isSupportedRecordType(item[key])) { + acc[key] = item[key] as any; + } else if (serializer) { + const value = item[key]; + if (value !== undefined) { + acc[key] = serializer(value); + } + } else { + console.warn(`Don't know how to serialize ${item[key]}`); + acc[key] = item[key] as any; + } + return acc; + }, + {} as Record, + ); +} + +function isSupportedRecordType(t: any) { + return ["number", "string", "boolean", "null"].includes(typeof t) || t instanceof Date; +} diff --git a/sdk/connectedcache/arm-connectedcache/src/index.ts b/sdk/connectedcache/arm-connectedcache/src/index.ts new file mode 100644 index 00000000000..b62ace21ec1 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/src/index.ts @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { + PageSettings, + ContinuablePage, + PagedAsyncIterableIterator, +} from "./static-helpers/pagingHelpers.js"; + +export { ConnectedCacheClient } from "./connectedCacheClient.js"; +export { restorePoller, RestorePollerOptions } from "./restorePollerHelpers.js"; +export { + EnterpriseMccCacheNodeResource, + CacheNodeProperty, + KnownProvisioningState, + ProvisioningState, + CacheNodeEntity, + KnownBgpReviewStateEnum, + BgpReviewStateEnum, + KnownConfigurationState, + ConfigurationState, + KnownAutoUpdateRingType, + AutoUpdateRingType, + AdditionalCacheNodeProperties, + CacheNodeDriveConfiguration, + BgpConfiguration, + ProxyUrlConfiguration, + KnownProxyRequired, + ProxyRequired, + KnownOsType, + OsType, + KnownCycleType, + CycleType, + ErrorDetail, + ErrorAdditionalInfo, + TrackedResource, + Resource, + SystemData, + KnownCreatedByType, + CreatedByType, + ConnectedCachePatchResource, + MccCacheNodeInstallDetails, + CacheNodeInstallProperties, + EnterpriseMccCustomerResource, + CustomerProperty, + CustomerEntity, + AdditionalCustomerProperties, + KnownCustomerTransitState, + CustomerTransitState, + IspCacheNodeResource, + MccCacheNodeBgpCidrDetails, + BgpCidrsConfiguration, + IspCustomerResource, + CacheNodePreviewResource, + CacheNodeOldResponse, + EnterprisePreviewResource, + Operation, + OperationDisplay, + KnownOrigin, + Origin, + KnownActionType, + ActionType, + KnownVersions, +} from "./models/index.js"; +export { + ConnectedCacheClientOptionalParams, + OperationsListOptionalParams, + EnterpriseCustomerOperationsGetOptionalParams, + EnterpriseCustomerOperationsCreateOrUpdateOptionalParams, + EnterpriseCustomerOperationsUpdateOptionalParams, + EnterpriseCustomerOperationsDeleteOptionalParams, + EnterpriseCustomerOperationsListByResourceGroupOptionalParams, + EnterpriseCustomerOperationsListBySubscriptionOptionalParams, + CacheNodesOperationsGetOptionalParams, + CacheNodesOperationsCreateorUpdateOptionalParams, + CacheNodesOperationsDeleteOptionalParams, + CacheNodesOperationsUpdateOptionalParams, + CacheNodesOperationsListByResourceGroupOptionalParams, + CacheNodesOperationsListBySubscriptionOptionalParams, + IspCustomersGetOptionalParams, + IspCustomersCreateOrUpdateOptionalParams, + IspCustomersUpdateOptionalParams, + IspCustomersDeleteOptionalParams, + IspCustomersListByResourceGroupOptionalParams, + IspCustomersListBySubscriptionOptionalParams, + IspCacheNodesOperationsGetOptionalParams, + IspCacheNodesOperationsCreateOrUpdateOptionalParams, + IspCacheNodesOperationsUpdateOptionalParams, + IspCacheNodesOperationsDeleteOptionalParams, + IspCacheNodesOperationsListByIspCustomerResourceOptionalParams, + IspCacheNodesOperationsGetBgpCidrsOptionalParams, + IspCacheNodesOperationsGetCacheNodeInstallDetailsOptionalParams, + EnterpriseMccCustomersGetOptionalParams, + EnterpriseMccCustomersCreateOrUpdateOptionalParams, + EnterpriseMccCustomersUpdateOptionalParams, + EnterpriseMccCustomersDeleteOptionalParams, + EnterpriseMccCustomersListByResourceGroupOptionalParams, + EnterpriseMccCustomersListBySubscriptionOptionalParams, + EnterpriseMccCacheNodesOperationsGetOptionalParams, + EnterpriseMccCacheNodesOperationsCreateOrUpdateOptionalParams, + EnterpriseMccCacheNodesOperationsUpdateOptionalParams, + EnterpriseMccCacheNodesOperationsDeleteOptionalParams, + EnterpriseMccCacheNodesOperationsListByEnterpriseMccCustomerResourceOptionalParams, + EnterpriseMccCacheNodesOperationsGetCacheNodeInstallDetailsOptionalParams, +} from "./api/index.js"; +export { + CacheNodesOperationsOperations, + EnterpriseCustomerOperationsOperations, + EnterpriseMccCacheNodesOperationsOperations, + EnterpriseMccCustomersOperations, + IspCacheNodesOperationsOperations, + IspCustomersOperations, + OperationsOperations, +} from "./classic/index.js"; +export { PageSettings, ContinuablePage, PagedAsyncIterableIterator }; diff --git a/sdk/connectedcache/arm-connectedcache/src/logger.ts b/sdk/connectedcache/arm-connectedcache/src/logger.ts new file mode 100644 index 00000000000..dca00da0b62 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/src/logger.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { createClientLogger } from "@azure/logger"; +export const logger = createClientLogger("arm-connectedcache"); diff --git a/sdk/connectedcache/arm-connectedcache/src/models/index.ts b/sdk/connectedcache/arm-connectedcache/src/models/index.ts new file mode 100644 index 00000000000..33010303a2a --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/src/models/index.ts @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + EnterpriseMccCacheNodeResource, + CacheNodeProperty, + KnownProvisioningState, + ProvisioningState, + CacheNodeEntity, + KnownBgpReviewStateEnum, + BgpReviewStateEnum, + KnownConfigurationState, + ConfigurationState, + KnownAutoUpdateRingType, + AutoUpdateRingType, + AdditionalCacheNodeProperties, + CacheNodeDriveConfiguration, + BgpConfiguration, + ProxyUrlConfiguration, + KnownProxyRequired, + ProxyRequired, + KnownOsType, + OsType, + KnownCycleType, + CycleType, + ErrorDetail, + ErrorAdditionalInfo, + TrackedResource, + Resource, + SystemData, + KnownCreatedByType, + CreatedByType, + ConnectedCachePatchResource, + MccCacheNodeInstallDetails, + CacheNodeInstallProperties, + EnterpriseMccCustomerResource, + CustomerProperty, + CustomerEntity, + AdditionalCustomerProperties, + KnownCustomerTransitState, + CustomerTransitState, + IspCacheNodeResource, + MccCacheNodeBgpCidrDetails, + BgpCidrsConfiguration, + IspCustomerResource, + CacheNodePreviewResource, + CacheNodeOldResponse, + EnterprisePreviewResource, + Operation, + OperationDisplay, + KnownOrigin, + Origin, + KnownActionType, + ActionType, + KnownVersions, +} from "./models.js"; diff --git a/sdk/connectedcache/arm-connectedcache/src/models/models.ts b/sdk/connectedcache/arm-connectedcache/src/models/models.ts new file mode 100644 index 00000000000..fe5b88b1cd9 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/src/models/models.ts @@ -0,0 +1,1735 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** Represents the high level Nodes needed to provision cache node resources */ +export interface EnterpriseMccCacheNodeResource extends TrackedResource { + /** The resource-specific properties for this resource. */ + properties?: CacheNodeProperty; +} + +export function enterpriseMccCacheNodeResourceSerializer( + item: EnterpriseMccCacheNodeResource, +): any { + return { + tags: item["tags"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : cacheNodePropertySerializer(item["properties"]), + }; +} + +export function enterpriseMccCacheNodeResourceDeserializer( + item: any, +): EnterpriseMccCacheNodeResource { + return { + tags: item["tags"], + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : cacheNodePropertyDeserializer(item["properties"]), + }; +} + +/** Model representing an Mcc cache node connectedCache resource */ +export interface CacheNodeProperty { + /** The provisioned state of the resource */ + readonly provisioningState?: ProvisioningState; + /** Mcc cache node resource (cache node entity). */ + cacheNode?: CacheNodeEntity; + /** Mcc cache node resource additional properties. */ + additionalCacheNodeProperties?: AdditionalCacheNodeProperties; + /** Mcc response status code. */ + statusCode?: string; + /** Mcc response status text as string for retrieving status details. */ + statusText?: string; + /** Mcc response status details for retrieving response inner details. */ + statusDetails?: string; + /** HTTP error status code. */ + readonly status?: string; + /** Mcc response error details. */ + error?: ErrorDetail; +} + +export function cacheNodePropertySerializer(item: CacheNodeProperty): any { + return { + cacheNode: !item["cacheNode"] + ? item["cacheNode"] + : cacheNodeEntitySerializer(item["cacheNode"]), + additionalCacheNodeProperties: !item["additionalCacheNodeProperties"] + ? item["additionalCacheNodeProperties"] + : additionalCacheNodePropertiesSerializer(item["additionalCacheNodeProperties"]), + statusCode: item["statusCode"], + statusText: item["statusText"], + statusDetails: item["statusDetails"], + error: !item["error"] ? item["error"] : errorDetailSerializer(item["error"]), + }; +} + +export function cacheNodePropertyDeserializer(item: any): CacheNodeProperty { + return { + provisioningState: item["provisioningState"], + cacheNode: !item["cacheNode"] + ? item["cacheNode"] + : cacheNodeEntityDeserializer(item["cacheNode"]), + additionalCacheNodeProperties: !item["additionalCacheNodeProperties"] + ? item["additionalCacheNodeProperties"] + : additionalCacheNodePropertiesDeserializer(item["additionalCacheNodeProperties"]), + statusCode: item["statusCode"], + statusText: item["statusText"], + statusDetails: item["statusDetails"], + status: item["status"], + error: !item["error"] ? item["error"] : errorDetailDeserializer(item["error"]), + }; +} + +/** provisioning state of the resource */ +export enum KnownProvisioningState { + /** Resource has been created. */ + Succeeded = "Succeeded", + /** Resource creation failed. */ + Failed = "Failed", + /** Resource creation was canceled. */ + Canceled = "Canceled", + /** unknown state of the provisioning state */ + Unknown = "Unknown", + /** Accepted state of the provisioning state during the Async Operations */ + Accepted = "Accepted", + /** Upgrading state of the provisioning state */ + Upgrading = "Upgrading", + /** Deleting state of the provisioning state */ + Deleting = "Deleting", +} + +/** + * provisioning state of the resource \ + * {@link KnownProvisioningState} can be used interchangeably with ProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded**: Resource has been created. \ + * **Failed**: Resource creation failed. \ + * **Canceled**: Resource creation was canceled. \ + * **Unknown**: unknown state of the provisioning state \ + * **Accepted**: Accepted state of the provisioning state during the Async Operations \ + * **Upgrading**: Upgrading state of the provisioning state \ + * **Deleting**: Deleting state of the provisioning state + */ +export type ProvisioningState = string; + +/** Model representing Cache Node for ConnectedCache resource */ +export interface CacheNodeEntity { + /** Cache node resource Azure fully qualified resource Id. */ + fullyQualifiedResourceId?: string; + /** Cache node resource customer resource GUID Id. */ + readonly customerId?: string; + /** Cache node resource customer resource name. */ + customerName?: string; + /** Cache node resource Ip address. */ + ipAddress?: string; + /** Cache node resource customer index as string. */ + customerIndex?: string; + /** Cache node resource identifier of the cache node */ + cacheNodeId?: string; + /** Cache node resource name. */ + cacheNodeName?: string; + /** Cache node resource customer resource Asn (autonomous system number) */ + customerAsn?: number; + /** Cache node resource flag for indicating if cache node is enabled. */ + isEnabled?: boolean; + /** Cache node resource maximum allowed egress in Mbps. */ + maxAllowableEgressInMbps?: number; + /** Cache node resource maximum allowed probability of egress. */ + readonly maxAllowableProbability?: number; + /** Cache node resource Azure XCid. */ + readonly xCid?: string; + /** Cache node resource flag for determining if managed by enterprise as boolean. */ + isEnterpriseManaged?: boolean; + /** Cache node resource create async operation Id. */ + readonly createAsyncOperationId?: string; + /** Cache node resource deletion async operation Id. */ + readonly deleteAsyncOperationId?: string; + /** Cache node resource customer resource client tenant Id of subscription. */ + readonly clientTenantId?: string; + /** Cache node resource category. */ + readonly category?: string; + /** Cache node resource release version. */ + readonly releaseVersion?: number; + /** Cache node resource last sync timestamp. */ + readonly lastSyncWithAzureTimestamp?: Date; + /** Cache node resource last backend updated timestamp. */ + readonly lastUpdatedTimestamp?: Date; + /** Cache node resource attempts to sync with Azure. */ + readonly synchWithAzureAttemptsCount?: number; + /** Cache node resource container configuration details. */ + readonly containerConfigurations?: string; + /** Cache node resource comma separated values of Cidrs. */ + cidrCsv?: string[]; + /** Cache node resource last Cidr Csv update timestamp */ + readonly cidrCsvLastUpdateTime?: Date; + /** Cache node resource last Bgp Cidr Csv update timestamp */ + readonly bgpCidrCsvLastUpdateTime?: Date; + /** Cache node resource last Bgp report timestamp. */ + readonly bgpLastReportedTime?: Date; + /** Cache node resource Bgp review state string text in detail. */ + readonly bgpReviewStateText?: string; + /** Cache node resource Bgp review state string text. */ + readonly bgpReviewState?: BgpReviewStateEnum; + /** Cache node resource Bgp review feedback text. */ + readonly bgpReviewFeedback?: string; + /** Cache node resource Bgp update count. */ + readonly bgpNumberOfTimesUpdated?: number; + /** Cache node resource Bgp record count. */ + readonly bgpNumberOfRecords?: number; + /** Cache node resource Bgp block count. */ + readonly bgpCidrBlocksCount?: number; + /** Cache node resource total addressable space defined by Bgp and Cidr Csv blocks. */ + readonly bgpAddressSpace?: number; + /** Cache node resource flag for determining if customer will be migrated. */ + shouldMigrate?: boolean; + /** Cache node resource bytes truncated from Bgp output file. */ + readonly bgpFileBytesTruncated?: number; + /** Cache node resource current Cidr range precedence selection type. */ + cidrSelectionType?: number; + /** Cache node resource flag for indicating the cache node resource is frozen (not selectable, not editable in UI). */ + readonly isFrozen?: boolean; + /** Cache node resource review process state as integer */ + readonly reviewState?: number; + /** Cache node resource review state text. */ + readonly reviewStateText?: string; + /** Cache node resource review feedback text. */ + readonly reviewFeedback?: string; + /** Cache node resource configuration state. */ + readonly configurationState?: ConfigurationState; + /** Cache node resource configuration state text. */ + readonly configurationStateText?: string; + /** Cache node resource total addressable space defined by the Cidr Csv block. */ + readonly addressSpace?: number; + /** Cache node resource Mcc container deployment worker connection count. */ + readonly workerConnections?: number; + /** Cache node resource last updated Mcc container deployment worker connection count timestamp. */ + readonly workerConnectionsLastUpdatedDateTime?: Date; + /** Cache node resource Mcc container configuration details re-sync trigger. */ + readonly containerResyncTrigger?: number; + /** Cache node resource Mcc Container Id Uri. */ + readonly imageUri?: string; + /** FQDN(fully qualified domain name) value of the mcc cache node */ + fullyQualifiedDomainName?: string; + /** Auto Update Ring Type which is slow or fast etc. */ + autoUpdateRingType?: AutoUpdateRingType; + /** Customer requested week of month for mcc install of auto update cycle */ + autoUpdateRequestedWeek?: number; + /** Customer requested day of week for mcc install of auto update cycle */ + autoUpdateRequestedDay?: number; + /** Customer requested time of the day for mcc install of auto update cycle, should be hh:mm */ + autoUpdateRequestedTime?: string; +} + +export function cacheNodeEntitySerializer(item: CacheNodeEntity): any { + return { + fullyQualifiedResourceId: item["fullyQualifiedResourceId"], + customerName: item["customerName"], + ipAddress: item["ipAddress"], + customerIndex: item["customerIndex"], + cacheNodeId: item["cacheNodeId"], + cacheNodeName: item["cacheNodeName"], + customerAsn: item["customerAsn"], + isEnabled: item["isEnabled"], + maxAllowableEgressInMbps: item["maxAllowableEgressInMbps"], + isEnterpriseManaged: item["isEnterpriseManaged"], + cidrCsv: !item["cidrCsv"] + ? item["cidrCsv"] + : item["cidrCsv"].map((p: any) => { + return p; + }), + shouldMigrate: item["shouldMigrate"], + cidrSelectionType: item["cidrSelectionType"], + fullyQualifiedDomainName: item["fullyQualifiedDomainName"], + autoUpdateRingType: item["autoUpdateRingType"], + autoUpdateRequestedWeek: item["autoUpdateRequestedWeek"], + autoUpdateRequestedDay: item["autoUpdateRequestedDay"], + autoUpdateRequestedTime: item["autoUpdateRequestedTime"], + }; +} + +export function cacheNodeEntityDeserializer(item: any): CacheNodeEntity { + return { + fullyQualifiedResourceId: item["fullyQualifiedResourceId"], + customerId: item["customerId"], + customerName: item["customerName"], + ipAddress: item["ipAddress"], + customerIndex: item["customerIndex"], + cacheNodeId: item["cacheNodeId"], + cacheNodeName: item["cacheNodeName"], + customerAsn: item["customerAsn"], + isEnabled: item["isEnabled"], + maxAllowableEgressInMbps: item["maxAllowableEgressInMbps"], + maxAllowableProbability: item["maxAllowableProbability"], + xCid: item["xCid"], + isEnterpriseManaged: item["isEnterpriseManaged"], + createAsyncOperationId: item["createAsyncOperationId"], + deleteAsyncOperationId: item["deleteAsyncOperationId"], + clientTenantId: item["clientTenantId"], + category: item["category"], + releaseVersion: item["releaseVersion"], + lastSyncWithAzureTimestamp: !item["lastSyncWithAzureTimestamp"] + ? item["lastSyncWithAzureTimestamp"] + : new Date(item["lastSyncWithAzureTimestamp"]), + lastUpdatedTimestamp: !item["lastUpdatedTimestamp"] + ? item["lastUpdatedTimestamp"] + : new Date(item["lastUpdatedTimestamp"]), + synchWithAzureAttemptsCount: item["synchWithAzureAttemptsCount"], + containerConfigurations: item["containerConfigurations"], + cidrCsv: !item["cidrCsv"] + ? item["cidrCsv"] + : item["cidrCsv"].map((p: any) => { + return p; + }), + cidrCsvLastUpdateTime: !item["cidrCsvLastUpdateTime"] + ? item["cidrCsvLastUpdateTime"] + : new Date(item["cidrCsvLastUpdateTime"]), + bgpCidrCsvLastUpdateTime: !item["bgpCidrCsvLastUpdateTime"] + ? item["bgpCidrCsvLastUpdateTime"] + : new Date(item["bgpCidrCsvLastUpdateTime"]), + bgpLastReportedTime: !item["bgpLastReportedTime"] + ? item["bgpLastReportedTime"] + : new Date(item["bgpLastReportedTime"]), + bgpReviewStateText: item["bgpReviewStateText"], + bgpReviewState: item["bgpReviewState"], + bgpReviewFeedback: item["bgpReviewFeedback"], + bgpNumberOfTimesUpdated: item["bgpNumberOfTimesUpdated"], + bgpNumberOfRecords: item["bgpNumberOfRecords"], + bgpCidrBlocksCount: item["bgpCidrBlocksCount"], + bgpAddressSpace: item["bgpAddressSpace"], + shouldMigrate: item["shouldMigrate"], + bgpFileBytesTruncated: item["bgpFileBytesTruncated"], + cidrSelectionType: item["cidrSelectionType"], + isFrozen: item["isFrozen"], + reviewState: item["reviewState"], + reviewStateText: item["reviewStateText"], + reviewFeedback: item["reviewFeedback"], + configurationState: item["configurationState"], + configurationStateText: item["configurationStateText"], + addressSpace: item["addressSpace"], + workerConnections: item["workerConnections"], + workerConnectionsLastUpdatedDateTime: !item["workerConnectionsLastUpdatedDateTime"] + ? item["workerConnectionsLastUpdatedDateTime"] + : new Date(item["workerConnectionsLastUpdatedDateTime"]), + containerResyncTrigger: item["containerResyncTrigger"], + imageUri: item["imageUri"], + fullyQualifiedDomainName: item["fullyQualifiedDomainName"], + autoUpdateRingType: item["autoUpdateRingType"], + autoUpdateRequestedWeek: item["autoUpdateRequestedWeek"], + autoUpdateRequestedDay: item["autoUpdateRequestedDay"], + autoUpdateRequestedTime: item["autoUpdateRequestedTime"], + }; +} + +/** Cache node resource Bgp review state as integer */ +export enum KnownBgpReviewStateEnum { + /** bgp not configured */ + NotConfigured = "NotConfigured", + /** bgp is in review state */ + InReview = "InReview", + /** bgp is in Approved state */ + Approved = "Approved", + /** bgp is setup need an attention for more troubleshoot */ + AttentionRequired = "AttentionRequired", +} + +/** + * Cache node resource Bgp review state as integer \ + * {@link KnownBgpReviewStateEnum} can be used interchangeably with BgpReviewStateEnum, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **NotConfigured**: bgp not configured \ + * **InReview**: bgp is in review state \ + * **Approved**: bgp is in Approved state \ + * **AttentionRequired**: bgp is setup need an attention for more troubleshoot + */ +export type BgpReviewStateEnum = string; + +/** Cache node configuration setup state */ +export enum KnownConfigurationState { + /** connected cache setup configured */ + Configured = "Configured", + /** connected cache setup not configured */ + NotConfigured_Ip = "NotConfigured_Ip", +} + +/** + * Cache node configuration setup state \ + * {@link KnownConfigurationState} can be used interchangeably with ConfigurationState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Configured**: connected cache setup configured \ + * **NotConfigured_Ip**: connected cache setup not configured + */ +export type ConfigurationState = string; + +/** Auto update Ring type */ +export enum KnownAutoUpdateRingType { + /** customer selection of preview update install mcc on their physical vm */ + Preview = "Preview", + /** customer selection of slow update to install mcc on their physical vm */ + Slow = "Slow", + /** customer selection of fast / auto update to install mcc on their physical vm */ + Fast = "Fast", +} + +/** + * Auto update Ring type \ + * {@link KnownautoUpdateRingType} can be used interchangeably with autoUpdateRingType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Preview**: customer selection of preview update install mcc on their physical vm \ + * **Slow**: customer selection of slow update to install mcc on their physical vm \ + * **Fast**: customer selection of fast \/ auto update to install mcc on their physical vm + */ +export type AutoUpdateRingType = string; + +/** Model representing cache node for connected cache resource */ +export interface AdditionalCacheNodeProperties { + /** issues list to return the issues as part of the additional cache node properties */ + cacheNodePropertiesDetailsIssuesList?: string[]; + /** Cache node resource aggregated status details. */ + readonly aggregatedStatusDetails?: string; + /** Cache node resource aggregated status text. */ + readonly aggregatedStatusText?: string; + /** Cache node resource aggregated status code. */ + readonly aggregatedStatusCode?: number; + /** Cache node resource Mcc product version. */ + readonly productVersion?: string; + /** Cache node resource flag indicating if cache node has been physically installed or provisioned on their physical lab. */ + readonly isProvisioned?: boolean; + /** Cache node resource detailed state text. */ + readonly cacheNodeStateDetailedText?: string; + /** Cache node resource short state text. */ + readonly cacheNodeStateShortText?: string; + /** Cache node resource state as integer. */ + readonly cacheNodeState?: number; + /** Cache node resource drive configurations. */ + driveConfiguration?: CacheNodeDriveConfiguration[]; + /** Cache node resource Bgp configuration. */ + bgpConfiguration?: BgpConfiguration; + /** proxyUrl configuration of the cache node */ + proxyUrlConfiguration?: ProxyUrlConfiguration; + /** Cache node resource Mcc proxy Url */ + proxyUrl?: string; + /** Cache node resource requires a proxy */ + isProxyRequired?: ProxyRequired; + /** Operating system of the cache node */ + osType?: OsType; + /** Update Cycle Type */ + updateCycleType?: CycleType; + /** Auto update or fast update version */ + autoUpdateVersion?: string; + /** Update related information details */ + updateInfoDetails?: string; + /** customer requested date time for mcc install of update cycle */ + updateRequestedDateTime?: Date; + /** Auto update version that is the Next available version to update on mcc cache node */ + readonly autoUpdateNextAvailableVersion?: string; + /** Auto update last applied date time of mcc install */ + readonly autoUpdateNextAvailableDateTime?: Date; + /** Auto update version that is the applied to update on mcc cache node */ + readonly autoUpdateAppliedVersion?: string; + /** Auto Update status details from the backend after applying the new version details */ + readonly autoUpdateLastAppliedDetails?: string; + /** Last applied auto update state for mcc install of auto update cycle */ + readonly autoUpdateLastAppliedState?: string; + /** Auto update last applied date time of mcc install */ + readonly autoUpdateLastAppliedDateTime?: Date; + /** Auto update last triggered date time of mcc install */ + readonly autoUpdateLastTriggeredDateTime?: Date; + /** Optional property #1 of Mcc response object */ + optionalProperty1?: string; + /** Optional property #2 of Mcc response object */ + optionalProperty2?: string; + /** Optional property #3 of Mcc response object */ + optionalProperty3?: string; + /** Optional property #4 of Mcc response object */ + optionalProperty4?: string; + /** Optional property #5 of Mcc response object */ + optionalProperty5?: string; +} + +export function additionalCacheNodePropertiesSerializer(item: AdditionalCacheNodeProperties): any { + return { + cacheNodePropertiesDetailsIssuesList: !item["cacheNodePropertiesDetailsIssuesList"] + ? item["cacheNodePropertiesDetailsIssuesList"] + : item["cacheNodePropertiesDetailsIssuesList"].map((p: any) => { + return p; + }), + driveConfiguration: !item["driveConfiguration"] + ? item["driveConfiguration"] + : cacheNodeDriveConfigurationArraySerializer(item["driveConfiguration"]), + bgpConfiguration: !item["bgpConfiguration"] + ? item["bgpConfiguration"] + : bgpConfigurationSerializer(item["bgpConfiguration"]), + proxyUrlConfiguration: !item["proxyUrlConfiguration"] + ? item["proxyUrlConfiguration"] + : proxyUrlConfigurationSerializer(item["proxyUrlConfiguration"]), + proxyUrl: item["proxyUrl"], + isProxyRequired: item["isProxyRequired"], + osType: item["osType"], + updateCycleType: item["updateCycleType"], + autoUpdateVersion: item["autoUpdateVersion"], + updateInfoDetails: item["updateInfoDetails"], + updateRequestedDateTime: item["updateRequestedDateTime"]?.toISOString(), + optionalProperty1: item["optionalProperty1"], + optionalProperty2: item["optionalProperty2"], + optionalProperty3: item["optionalProperty3"], + optionalProperty4: item["optionalProperty4"], + optionalProperty5: item["optionalProperty5"], + }; +} + +export function additionalCacheNodePropertiesDeserializer( + item: any, +): AdditionalCacheNodeProperties { + return { + cacheNodePropertiesDetailsIssuesList: !item["cacheNodePropertiesDetailsIssuesList"] + ? item["cacheNodePropertiesDetailsIssuesList"] + : item["cacheNodePropertiesDetailsIssuesList"].map((p: any) => { + return p; + }), + aggregatedStatusDetails: item["aggregatedStatusDetails"], + aggregatedStatusText: item["aggregatedStatusText"], + aggregatedStatusCode: item["aggregatedStatusCode"], + productVersion: item["productVersion"], + isProvisioned: item["isProvisioned"], + cacheNodeStateDetailedText: item["cacheNodeStateDetailedText"], + cacheNodeStateShortText: item["cacheNodeStateShortText"], + cacheNodeState: item["cacheNodeState"], + driveConfiguration: !item["driveConfiguration"] + ? item["driveConfiguration"] + : cacheNodeDriveConfigurationArrayDeserializer(item["driveConfiguration"]), + bgpConfiguration: !item["bgpConfiguration"] + ? item["bgpConfiguration"] + : bgpConfigurationDeserializer(item["bgpConfiguration"]), + proxyUrlConfiguration: !item["proxyUrlConfiguration"] + ? item["proxyUrlConfiguration"] + : proxyUrlConfigurationDeserializer(item["proxyUrlConfiguration"]), + proxyUrl: item["proxyUrl"], + isProxyRequired: item["isProxyRequired"], + osType: item["osType"], + updateCycleType: item["updateCycleType"], + autoUpdateVersion: item["autoUpdateVersion"], + updateInfoDetails: item["updateInfoDetails"], + updateRequestedDateTime: !item["updateRequestedDateTime"] + ? item["updateRequestedDateTime"] + : new Date(item["updateRequestedDateTime"]), + autoUpdateNextAvailableVersion: item["autoUpdateNextAvailableVersion"], + autoUpdateNextAvailableDateTime: !item["autoUpdateNextAvailableDateTime"] + ? item["autoUpdateNextAvailableDateTime"] + : new Date(item["autoUpdateNextAvailableDateTime"]), + autoUpdateAppliedVersion: item["autoUpdateAppliedVersion"], + autoUpdateLastAppliedDetails: item["autoUpdateLastAppliedDetails"], + autoUpdateLastAppliedState: item["autoUpdateLastAppliedState"], + autoUpdateLastAppliedDateTime: !item["autoUpdateLastAppliedDateTime"] + ? item["autoUpdateLastAppliedDateTime"] + : new Date(item["autoUpdateLastAppliedDateTime"]), + autoUpdateLastTriggeredDateTime: !item["autoUpdateLastTriggeredDateTime"] + ? item["autoUpdateLastTriggeredDateTime"] + : new Date(item["autoUpdateLastTriggeredDateTime"]), + optionalProperty1: item["optionalProperty1"], + optionalProperty2: item["optionalProperty2"], + optionalProperty3: item["optionalProperty3"], + optionalProperty4: item["optionalProperty4"], + optionalProperty5: item["optionalProperty5"], + }; +} + +export function cacheNodeDriveConfigurationArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return cacheNodeDriveConfigurationSerializer(item); + }); +} + +export function cacheNodeDriveConfigurationArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return cacheNodeDriveConfigurationDeserializer(item); + }); +} + +/** Drive configuration for cache node */ +export interface CacheNodeDriveConfiguration { + /** physical path location of the folder used for caching content */ + physicalPath?: string; + /** physical size of the drive used for caching content */ + sizeInGb?: number; + /** corresponding nginx cache number. Valid cache numbers are 1 - 20 */ + cacheNumber?: number; + /** full binding for corresponding nginx cache drive */ + nginxMapping?: string; +} + +export function cacheNodeDriveConfigurationSerializer(item: CacheNodeDriveConfiguration): any { + return { + physicalPath: item["physicalPath"], + sizeInGb: item["sizeInGb"], + cacheNumber: item["cacheNumber"], + nginxMapping: item["nginxMapping"], + }; +} + +export function cacheNodeDriveConfigurationDeserializer(item: any): CacheNodeDriveConfiguration { + return { + physicalPath: item["physicalPath"], + sizeInGb: item["sizeInGb"], + cacheNumber: item["cacheNumber"], + nginxMapping: item["nginxMapping"], + }; +} + +/** Bgp configuration of cache node */ +export interface BgpConfiguration { + /** Asn to ip address mapping */ + asnToIpAddressMapping?: string; +} + +export function bgpConfigurationSerializer(item: BgpConfiguration): any { + return { asnToIpAddressMapping: item["asnToIpAddressMapping"] }; +} + +export function bgpConfigurationDeserializer(item: any): BgpConfiguration { + return { + asnToIpAddressMapping: item["asnToIpAddressMapping"], + }; +} + +/** ProxyUrl configuration of cache node */ +export interface ProxyUrlConfiguration { + /** Host Proxy Address configuration along with port number. This can be a proxy or ip address. ex: xx.xx.xx.xxxx:80 or host name http://exampleproxy.com:80 */ + proxyUrl?: string; +} + +export function proxyUrlConfigurationSerializer(item: ProxyUrlConfiguration): any { + return { proxyUrl: item["proxyUrl"] }; +} + +export function proxyUrlConfigurationDeserializer(item: any): ProxyUrlConfiguration { + return { + proxyUrl: item["proxyUrl"], + }; +} + +/** Proxy details enum */ +export enum KnownProxyRequired { + /** Proxy is not required in setup */ + None = "None", + /** proxy is required in setup */ + Required = "Required", +} + +/** + * Proxy details enum \ + * {@link KnownProxyRequired} can be used interchangeably with ProxyRequired, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None**: Proxy is not required in setup \ + * **Required**: proxy is required in setup + */ +export type ProxyRequired = string; + +/** Operating System of the cache node */ +export enum KnownOsType { + /** cache node installs on windows operating system */ + Windows = "Windows", + /** cache node installs on Linux Operating system */ + Linux = "Linux", + /** cache node installs on Azure Eflow */ + Eflow = "Eflow", +} + +/** + * Operating System of the cache node \ + * {@link KnownOsType} can be used interchangeably with OsType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Windows**: cache node installs on windows operating system \ + * **Linux**: cache node installs on Linux Operating system \ + * **Eflow**: cache node installs on Azure Eflow + */ +export type OsType = string; + +/** Update Cycle type */ +export enum KnownCycleType { + /** customer selection of preview update install mcc on their physical vm */ + Preview = "Preview", + /** customer selection of slow update to install mcc on their physical vm */ + Slow = "Slow", + /** customer selection of fast / auto update to install mcc on their physical vm */ + Fast = "Fast", +} + +/** + * Update Cycle type \ + * {@link KnownCycleType} can be used interchangeably with CycleType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Preview**: customer selection of preview update install mcc on their physical vm \ + * **Slow**: customer selection of slow update to install mcc on their physical vm \ + * **Fast**: customer selection of fast \/ auto update to install mcc on their physical vm + */ +export type CycleType = string; + +/** The error detail. */ +export interface ErrorDetail { + /** The error code. */ + readonly code?: string; + /** The error message. */ + readonly message?: string; + /** The error target. */ + readonly target?: string; + /** The error details. */ + readonly details?: ErrorDetail[]; + /** The error additional info. */ + readonly additionalInfo?: ErrorAdditionalInfo[]; +} + +export function errorDetailSerializer(item: ErrorDetail): any { + return item; +} + +export function errorDetailDeserializer(item: any): ErrorDetail { + return { + code: item["code"], + message: item["message"], + target: item["target"], + details: !item["details"] ? item["details"] : errorDetailArrayDeserializer(item["details"]), + additionalInfo: !item["additionalInfo"] + ? item["additionalInfo"] + : errorAdditionalInfoArrayDeserializer(item["additionalInfo"]), + }; +} + +export function errorDetailArraySerializer(result: Array): any[] { + return result.map((item) => { + return errorDetailSerializer(item); + }); +} + +export function errorDetailArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return errorDetailDeserializer(item); + }); +} + +export function errorAdditionalInfoArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return errorAdditionalInfoDeserializer(item); + }); +} + +/** The resource management error additional info. */ +export interface ErrorAdditionalInfo { + /** The additional info type. */ + readonly type?: string; + /** The additional info. */ + readonly info?: Record; +} + +export function errorAdditionalInfoDeserializer(item: any): ErrorAdditionalInfo { + return { + type: item["type"], + info: !item["info"] ? item["info"] : _errorAdditionalInfoInfoDeserializer(item["info"]), + }; +} + +/** model interface _ErrorAdditionalInfoInfo */ +export interface _ErrorAdditionalInfoInfo {} + +export function _errorAdditionalInfoInfoDeserializer(item: any): _ErrorAdditionalInfoInfo { + return item; +} + +/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ +export interface TrackedResource extends Resource { + /** Resource tags. */ + tags?: Record; + /** The geo-location where the resource lives */ + location: string; +} + +export function trackedResourceSerializer(item: TrackedResource): any { + return { tags: item["tags"], location: item["location"] }; +} + +export function trackedResourceDeserializer(item: any): TrackedResource { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + tags: item["tags"], + location: item["location"], + }; +} + +/** Common fields that are returned in the response for all Azure Resource Manager resources */ +export interface Resource { + /** Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} */ + readonly id?: string; + /** The name of the resource */ + readonly name?: string; + /** The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" */ + readonly type?: string; + /** Azure Resource Manager metadata containing createdBy and modifiedBy information. */ + readonly systemData?: SystemData; +} + +export function resourceSerializer(item: Resource): any { + return item; +} + +export function resourceDeserializer(item: any): Resource { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + }; +} + +/** Metadata pertaining to creation and last modification of the resource. */ +export interface SystemData { + /** The identity that created the resource. */ + createdBy?: string; + /** The type of identity that created the resource. */ + createdByType?: CreatedByType; + /** The timestamp of resource creation (UTC). */ + createdAt?: Date; + /** The identity that last modified the resource. */ + lastModifiedBy?: string; + /** The type of identity that last modified the resource. */ + lastModifiedByType?: CreatedByType; + /** The timestamp of resource last modification (UTC) */ + lastModifiedAt?: Date; +} + +export function systemDataDeserializer(item: any): SystemData { + return { + createdBy: item["createdBy"], + createdByType: item["createdByType"], + createdAt: !item["createdAt"] ? item["createdAt"] : new Date(item["createdAt"]), + lastModifiedBy: item["lastModifiedBy"], + lastModifiedByType: item["lastModifiedByType"], + lastModifiedAt: !item["lastModifiedAt"] + ? item["lastModifiedAt"] + : new Date(item["lastModifiedAt"]), + }; +} + +/** The kind of entity that created the resource. */ +export enum KnownCreatedByType { + /** The entity was created by a user. */ + User = "User", + /** The entity was created by an application. */ + Application = "Application", + /** The entity was created by a managed identity. */ + ManagedIdentity = "ManagedIdentity", + /** The entity was created by a key. */ + Key = "Key", +} + +/** + * The kind of entity that created the resource. \ + * {@link KnowncreatedByType} can be used interchangeably with createdByType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **User**: The entity was created by a user. \ + * **Application**: The entity was created by an application. \ + * **ManagedIdentity**: The entity was created by a managed identity. \ + * **Key**: The entity was created by a key. + */ +export type CreatedByType = string; + +/** Mcc PATCH operation properties. */ +export interface ConnectedCachePatchResource { + /** Resource tags. */ + tags?: Record; +} + +export function connectedCachePatchResourceSerializer(item: ConnectedCachePatchResource): any { + return { tags: item["tags"] }; +} + +/** The response of a EnterpriseMccCacheNodeResource list operation. */ +export interface _EnterpriseMccCacheNodeResourceListResult { + /** The EnterpriseMccCacheNodeResource items on this page */ + value: EnterpriseMccCacheNodeResource[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _enterpriseMccCacheNodeResourceListResultDeserializer( + item: any, +): _EnterpriseMccCacheNodeResourceListResult { + return { + value: enterpriseMccCacheNodeResourceArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function enterpriseMccCacheNodeResourceArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return enterpriseMccCacheNodeResourceSerializer(item); + }); +} + +export function enterpriseMccCacheNodeResourceArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return enterpriseMccCacheNodeResourceDeserializer(item); + }); +} + +/** Mcc cache node resource all install details. */ +export interface MccCacheNodeInstallDetails extends TrackedResource { + /** Mcc cache node resource install script details. */ + properties?: CacheNodeInstallProperties; +} + +export function mccCacheNodeInstallDetailsDeserializer(item: any): MccCacheNodeInstallDetails { + return { + tags: item["tags"], + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : cacheNodeInstallPropertiesDeserializer(item["properties"]), + }; +} + +/** Mcc cache node resource install script properties. */ +export interface CacheNodeInstallProperties { + /** Mcc customer resource Id. */ + customerId?: string; + /** Mcc cache node resource Id. */ + cacheNodeId?: string; + /** Mcc primary account key. Internal to Mcc. */ + readonly primaryAccountKey?: string; + /** Mcc secondary account key. Internal to Mcc. */ + readonly secondaryAccountKey?: string; + /** Mcc Iot Central temporary device registration key, used once. */ + readonly registrationKey?: string; +} + +export function cacheNodeInstallPropertiesDeserializer(item: any): CacheNodeInstallProperties { + return { + customerId: item["customerId"], + cacheNodeId: item["cacheNodeId"], + primaryAccountKey: item["primaryAccountKey"], + secondaryAccountKey: item["secondaryAccountKey"], + registrationKey: item["registrationKey"], + }; +} + +/** Represents the high level Nodes needed to provision customer resources */ +export interface EnterpriseMccCustomerResource extends TrackedResource { + /** The resource-specific properties for this resource. */ + properties?: CustomerProperty; +} + +export function enterpriseMccCustomerResourceSerializer(item: EnterpriseMccCustomerResource): any { + return { + tags: item["tags"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : customerPropertySerializer(item["properties"]), + }; +} + +export function enterpriseMccCustomerResourceDeserializer( + item: any, +): EnterpriseMccCustomerResource { + return { + tags: item["tags"], + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : customerPropertyDeserializer(item["properties"]), + }; +} + +/** Model representing customer for connectedCache resource */ +export interface CustomerProperty { + /** The provisioned state of the resource */ + readonly provisioningState?: ProvisioningState; + /** Mcc customer resource (customer entity). */ + customer?: CustomerEntity; + /** Mcc customer resource additional properties. */ + additionalCustomerProperties?: AdditionalCustomerProperties; + /** Mcc response status code. */ + readonly statusCode?: string; + /** Mcc response status text as string for retrieving status details. */ + readonly statusText?: string; + /** Mcc response status details for retrieving response inner details. */ + readonly statusDetails?: string; + /** HTTP error status code. */ + readonly status?: string; + /** Mcc response error details. */ + readonly error?: ErrorDetail; +} + +export function customerPropertySerializer(item: CustomerProperty): any { + return { + customer: !item["customer"] ? item["customer"] : customerEntitySerializer(item["customer"]), + additionalCustomerProperties: !item["additionalCustomerProperties"] + ? item["additionalCustomerProperties"] + : additionalCustomerPropertiesSerializer(item["additionalCustomerProperties"]), + }; +} + +export function customerPropertyDeserializer(item: any): CustomerProperty { + return { + provisioningState: item["provisioningState"], + customer: !item["customer"] ? item["customer"] : customerEntityDeserializer(item["customer"]), + additionalCustomerProperties: !item["additionalCustomerProperties"] + ? item["additionalCustomerProperties"] + : additionalCustomerPropertiesDeserializer(item["additionalCustomerProperties"]), + statusCode: item["statusCode"], + statusText: item["statusText"], + statusDetails: item["statusDetails"], + status: item["status"], + error: !item["error"] ? item["error"] : errorDetailDeserializer(item["error"]), + }; +} + +/** Model representing Customer resource for ConnectedCache resource */ +export interface CustomerEntity { + /** Customer resource Azure fully qualified resource Id. */ + fullyQualifiedResourceId?: string; + /** Customer resource Guid Id. */ + readonly customerId?: string; + /** Customer resource name. */ + customerName?: string; + /** Customer resource contact email. */ + contactEmail?: string; + /** Customer resource contact phone. */ + contactPhone?: string; + /** Customer resource contact full name. */ + contactName?: string; + /** Customer resource entitlement flag as boolean. */ + isEntitled?: boolean; + /** Customer resource Mcc release version. */ + releaseVersion?: number; + /** Customer resource create async operation Id. */ + readonly createAsyncOperationId?: string; + /** Customer resource deletion async operation Id. */ + readonly deleteAsyncOperationId?: string; + /** Customer resource client tenant Id of subscription. */ + clientTenantId?: string; + /** Customer resource sync attempts. */ + readonly synchWithAzureAttemptsCount?: number; + /** Customer resource last Azure sync timestamp. */ + readonly lastSyncWithAzureTimestamp?: Date; + /** Customer resource flag for enterprise management as boolean. */ + isEnterpriseManaged?: boolean; + /** Customer resource flag for migration. */ + shouldMigrate?: boolean; + /** Customer resource flag for resending signup code as boolean. */ + resendSignupCode?: boolean; + /** Customer resource flag for requiring verification of signup code as boolean. */ + verifySignupCode?: boolean; + /** Customer resource phrase for verifying signup. */ + verifySignupPhrase?: string; +} + +export function customerEntitySerializer(item: CustomerEntity): any { + return { + fullyQualifiedResourceId: item["fullyQualifiedResourceId"], + customerName: item["customerName"], + contactEmail: item["contactEmail"], + contactPhone: item["contactPhone"], + contactName: item["contactName"], + isEntitled: item["isEntitled"], + releaseVersion: item["releaseVersion"], + clientTenantId: item["clientTenantId"], + isEnterpriseManaged: item["isEnterpriseManaged"], + shouldMigrate: item["shouldMigrate"], + resendSignupCode: item["resendSignupCode"], + verifySignupCode: item["verifySignupCode"], + verifySignupPhrase: item["verifySignupPhrase"], + }; +} + +export function customerEntityDeserializer(item: any): CustomerEntity { + return { + fullyQualifiedResourceId: item["fullyQualifiedResourceId"], + customerId: item["customerId"], + customerName: item["customerName"], + contactEmail: item["contactEmail"], + contactPhone: item["contactPhone"], + contactName: item["contactName"], + isEntitled: item["isEntitled"], + releaseVersion: item["releaseVersion"], + createAsyncOperationId: item["createAsyncOperationId"], + deleteAsyncOperationId: item["deleteAsyncOperationId"], + clientTenantId: item["clientTenantId"], + synchWithAzureAttemptsCount: item["synchWithAzureAttemptsCount"], + lastSyncWithAzureTimestamp: !item["lastSyncWithAzureTimestamp"] + ? item["lastSyncWithAzureTimestamp"] + : new Date(item["lastSyncWithAzureTimestamp"]), + isEnterpriseManaged: item["isEnterpriseManaged"], + shouldMigrate: item["shouldMigrate"], + resendSignupCode: item["resendSignupCode"], + verifySignupCode: item["verifySignupCode"], + verifySignupPhrase: item["verifySignupPhrase"], + }; +} + +/** Model representing customer for connected cache resource */ +export interface AdditionalCustomerProperties { + /** Customer resource last PeeringDB update timestamp. */ + readonly peeringDbLastUpdateTime?: Date; + /** Customer resource cache efficiency. */ + readonly customerPropertiesOverviewCacheEfficiency?: number; + /** Customer resource average egress in Mbps. */ + readonly customerPropertiesOverviewAverageEgressMbps?: number; + /** Customer resource average cache miss throughput in Mbps. */ + readonly customerPropertiesOverviewAverageMissMbps?: number; + /** Customer resource maximum egress in Mbps. */ + readonly customerPropertiesOverviewEgressMbpsMax?: number; + /** Customer resource peak egress timestamp. */ + readonly customerPropertiesOverviewEgressMbpsMaxDateTime?: Date; + /** Customer resource maximum cache miss throughput in Mbps. */ + readonly customerPropertiesOverviewMissMbpsMax?: number; + /** Customer resource peak cache miss throughput timestamp. */ + readonly customerPropertiesOverviewMissMbpsMaxDateTime?: Date; + /** Customer resource total healthy cache nodes. */ + readonly customerPropertiesOverviewCacheNodesHealthyCount?: number; + /** Customer resource total unhealthy cache nodes. */ + readonly customerPropertiesOverviewCacheNodesUnhealthyCount?: number; + /** Customer resource signup status as boolean. */ + readonly signupStatus?: boolean; + /** Customer resource signup status as integer code. */ + readonly signupStatusCode?: number; + /** Customer resource signup status as string text. */ + readonly signupStatusText?: string; + /** Customer resource signup phase status code as integer. */ + readonly signupPhaseStatusCode?: number; + /** Customer resource signup phase status as string text. */ + readonly signupPhaseStatusText?: string; + /** Customer resource last PeeringDB update timestamp. */ + readonly peeringDbLastUpdateDate?: Date; + /** Customer resource owner organization name. */ + readonly customerOrgName?: string; + /** Customer resource contact email. */ + customerEmail?: string; + /** Customer resource transit Asn (autonomous system number). */ + customerTransitAsn?: string; + /** Customer resource transit state. */ + customerTransitState?: CustomerTransitState; + /** Customer resource Asn (autonomous system number). */ + customerAsn?: string; + /** Customer resource estimated Asn peering peak in Gbps. */ + readonly customerAsnEstimatedEgressPeekGbps?: number; + /** Customer resource entitlement Sku Id. */ + customerEntitlementSkuId?: string; + /** Customer resource entitlement Sku Guid. */ + customerEntitlementSkuGuid?: string; + /** Customer resource entitlement Sku name. */ + customerEntitlementSkuName?: string; + /** Customer resource entitlement expiration date string. */ + customerEntitlementExpiration?: Date; + /** Optional property #1 of Mcc response object. */ + optionalProperty1?: string; + /** Optional property #2 of Mcc response object. */ + optionalProperty2?: string; + /** Optional property #3 of Mcc response object. */ + optionalProperty3?: string; + /** Optional property #4 of Mcc response object. */ + optionalProperty4?: string; + /** Optional property #5 of Mcc response object. */ + optionalProperty5?: string; +} + +export function additionalCustomerPropertiesSerializer(item: AdditionalCustomerProperties): any { + return { + customerEmail: item["customerEmail"], + customerTransitAsn: item["customerTransitAsn"], + customerTransitState: item["customerTransitState"], + customerAsn: item["customerAsn"], + customerEntitlementSkuId: item["customerEntitlementSkuId"], + customerEntitlementSkuGuid: item["customerEntitlementSkuGuid"], + customerEntitlementSkuName: item["customerEntitlementSkuName"], + customerEntitlementExpiration: item["customerEntitlementExpiration"]?.toISOString(), + optionalProperty1: item["optionalProperty1"], + optionalProperty2: item["optionalProperty2"], + optionalProperty3: item["optionalProperty3"], + optionalProperty4: item["optionalProperty4"], + optionalProperty5: item["optionalProperty5"], + }; +} + +export function additionalCustomerPropertiesDeserializer(item: any): AdditionalCustomerProperties { + return { + peeringDbLastUpdateTime: !item["peeringDbLastUpdateTime"] + ? item["peeringDbLastUpdateTime"] + : new Date(item["peeringDbLastUpdateTime"]), + customerPropertiesOverviewCacheEfficiency: item["customerPropertiesOverviewCacheEfficiency"], + customerPropertiesOverviewAverageEgressMbps: + item["customerPropertiesOverviewAverageEgressMbps"], + customerPropertiesOverviewAverageMissMbps: item["customerPropertiesOverviewAverageMissMbps"], + customerPropertiesOverviewEgressMbpsMax: item["customerPropertiesOverviewEgressMbpsMax"], + customerPropertiesOverviewEgressMbpsMaxDateTime: !item[ + "customerPropertiesOverviewEgressMbpsMaxDateTime" + ] + ? item["customerPropertiesOverviewEgressMbpsMaxDateTime"] + : new Date(item["customerPropertiesOverviewEgressMbpsMaxDateTime"]), + customerPropertiesOverviewMissMbpsMax: item["customerPropertiesOverviewMissMbpsMax"], + customerPropertiesOverviewMissMbpsMaxDateTime: !item[ + "customerPropertiesOverviewMissMbpsMaxDateTime" + ] + ? item["customerPropertiesOverviewMissMbpsMaxDateTime"] + : new Date(item["customerPropertiesOverviewMissMbpsMaxDateTime"]), + customerPropertiesOverviewCacheNodesHealthyCount: + item["customerPropertiesOverviewCacheNodesHealthyCount"], + customerPropertiesOverviewCacheNodesUnhealthyCount: + item["customerPropertiesOverviewCacheNodesUnhealthyCount"], + signupStatus: item["signupStatus"], + signupStatusCode: item["signupStatusCode"], + signupStatusText: item["signupStatusText"], + signupPhaseStatusCode: item["signupPhaseStatusCode"], + signupPhaseStatusText: item["signupPhaseStatusText"], + peeringDbLastUpdateDate: !item["peeringDbLastUpdateDate"] + ? item["peeringDbLastUpdateDate"] + : new Date(item["peeringDbLastUpdateDate"]), + customerOrgName: item["customerOrgName"], + customerEmail: item["customerEmail"], + customerTransitAsn: item["customerTransitAsn"], + customerTransitState: item["customerTransitState"], + customerAsn: item["customerAsn"], + customerAsnEstimatedEgressPeekGbps: item["customerAsnEstimatedEgressPeekGbps"], + customerEntitlementSkuId: item["customerEntitlementSkuId"], + customerEntitlementSkuGuid: item["customerEntitlementSkuGuid"], + customerEntitlementSkuName: item["customerEntitlementSkuName"], + customerEntitlementExpiration: !item["customerEntitlementExpiration"] + ? item["customerEntitlementExpiration"] + : new Date(item["customerEntitlementExpiration"]), + optionalProperty1: item["optionalProperty1"], + optionalProperty2: item["optionalProperty2"], + optionalProperty3: item["optionalProperty3"], + optionalProperty4: item["optionalProperty4"], + optionalProperty5: item["optionalProperty5"], + }; +} + +/** Customer resource transit states */ +export enum KnownCustomerTransitState { + /** do not have transit */ + NoTransit = "NoTransit", + /** transit provider and have own subscribers */ + CombinedTransit = "CombinedTransit", + /** pure transit provider or network service provider */ + TransitOnly = "TransitOnly", +} + +/** + * Customer resource transit states \ + * {@link KnownCustomerTransitState} can be used interchangeably with CustomerTransitState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **NoTransit**: do not have transit \ + * **CombinedTransit**: transit provider and have own subscribers \ + * **TransitOnly**: pure transit provider or network service provider + */ +export type CustomerTransitState = string; + +/** The response of a EnterpriseMccCustomerResource list operation. */ +export interface _EnterpriseMccCustomerResourceListResult { + /** The EnterpriseMccCustomerResource items on this page */ + value: EnterpriseMccCustomerResource[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _enterpriseMccCustomerResourceListResultDeserializer( + item: any, +): _EnterpriseMccCustomerResourceListResult { + return { + value: enterpriseMccCustomerResourceArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function enterpriseMccCustomerResourceArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return enterpriseMccCustomerResourceSerializer(item); + }); +} + +export function enterpriseMccCustomerResourceArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return enterpriseMccCustomerResourceDeserializer(item); + }); +} + +/** Represents the high level Nodes needed to provision cache node resources */ +export interface IspCacheNodeResource extends TrackedResource { + /** The resource-specific properties for this resource. */ + properties?: CacheNodeProperty; +} + +export function ispCacheNodeResourceSerializer(item: IspCacheNodeResource): any { + return { + tags: item["tags"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : cacheNodePropertySerializer(item["properties"]), + }; +} + +export function ispCacheNodeResourceDeserializer(item: any): IspCacheNodeResource { + return { + tags: item["tags"], + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : cacheNodePropertyDeserializer(item["properties"]), + }; +} + +/** The response of a IspCacheNodeResource list operation. */ +export interface _IspCacheNodeResourceListResult { + /** The IspCacheNodeResource items on this page */ + value: IspCacheNodeResource[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _ispCacheNodeResourceListResultDeserializer( + item: any, +): _IspCacheNodeResourceListResult { + return { + value: ispCacheNodeResourceArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function ispCacheNodeResourceArraySerializer(result: Array): any[] { + return result.map((item) => { + return ispCacheNodeResourceSerializer(item); + }); +} + +export function ispCacheNodeResourceArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return ispCacheNodeResourceDeserializer(item); + }); +} + +/** Represents all Cidr details of the Bgp request for a specific cache node resource */ +export interface MccCacheNodeBgpCidrDetails extends TrackedResource { + /** Mcc cache node resource Bgp Cidr properties. */ + properties?: BgpCidrsConfiguration; +} + +export function mccCacheNodeBgpCidrDetailsDeserializer(item: any): MccCacheNodeBgpCidrDetails { + return { + tags: item["tags"], + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : bgpCidrsConfigurationDeserializer(item["properties"]), + }; +} + +/** Mcc cache node Bgp Cidr details. */ +export interface BgpCidrsConfiguration { + /** Mcc cache node Bgp Cidr details. */ + readonly bgpCidrs?: string[]; +} + +export function bgpCidrsConfigurationDeserializer(item: any): BgpCidrsConfiguration { + return { + bgpCidrs: !item["bgpCidrs"] + ? item["bgpCidrs"] + : item["bgpCidrs"].map((p: any) => { + return p; + }), + }; +} + +/** Represents the high level Nodes needed to provision isp customer resources */ +export interface IspCustomerResource extends TrackedResource { + /** The resource-specific properties for this resource. */ + properties?: CustomerProperty; +} + +export function ispCustomerResourceSerializer(item: IspCustomerResource): any { + return { + tags: item["tags"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : customerPropertySerializer(item["properties"]), + }; +} + +export function ispCustomerResourceDeserializer(item: any): IspCustomerResource { + return { + tags: item["tags"], + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : customerPropertyDeserializer(item["properties"]), + }; +} + +/** The response of a IspCustomerResource list operation. */ +export interface _IspCustomerResourceListResult { + /** The IspCustomerResource items on this page */ + value: IspCustomerResource[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _ispCustomerResourceListResultDeserializer( + item: any, +): _IspCustomerResourceListResult { + return { + value: ispCustomerResourceArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function ispCustomerResourceArraySerializer(result: Array): any[] { + return result.map((item) => { + return ispCustomerResourceSerializer(item); + }); +} + +export function ispCustomerResourceArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return ispCustomerResourceDeserializer(item); + }); +} + +/** Concrete tracked resource types can be created by aliasing this type using a specific property type. */ +export interface CacheNodePreviewResource extends TrackedResource { + /** The resource-specific properties for this resource. */ + properties?: CacheNodeOldResponse; +} + +export function cacheNodePreviewResourceSerializer(item: CacheNodePreviewResource): any { + return { + tags: item["tags"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : cacheNodeOldResponseSerializer(item["properties"]), + }; +} + +export function cacheNodePreviewResourceDeserializer(item: any): CacheNodePreviewResource { + return { + tags: item["tags"], + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : cacheNodeOldResponseDeserializer(item["properties"]), + }; +} + +/** Model representing Cache Node for ConnectedCache resource */ +export interface CacheNodeOldResponse { + /** The provisioned state of the resource */ + readonly provisioningState?: ProvisioningState; + /** statusCode used to get code details of Mcc response object */ + statusCode?: string; + /** statusText used to get status details in string format of Mcc response object */ + statusText?: string; + /** statusDetails used to get inner details of Mcc response object */ + statusDetails?: string; + /** status of the HTTP error code */ + readonly status?: string; + /** The error details */ + error?: ErrorDetail; +} + +export function cacheNodeOldResponseSerializer(item: CacheNodeOldResponse): any { + return { + statusCode: item["statusCode"], + statusText: item["statusText"], + statusDetails: item["statusDetails"], + error: !item["error"] ? item["error"] : errorDetailSerializer(item["error"]), + }; +} + +export function cacheNodeOldResponseDeserializer(item: any): CacheNodeOldResponse { + return { + provisioningState: item["provisioningState"], + statusCode: item["statusCode"], + statusText: item["statusText"], + statusDetails: item["statusDetails"], + status: item["status"], + error: !item["error"] ? item["error"] : errorDetailDeserializer(item["error"]), + }; +} + +/** The response of a CacheNodePreviewResource list operation. */ +export interface _CacheNodePreviewResourceListResult { + /** The CacheNodePreviewResource items on this page */ + value: CacheNodePreviewResource[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _cacheNodePreviewResourceListResultDeserializer( + item: any, +): _CacheNodePreviewResourceListResult { + return { + value: cacheNodePreviewResourceArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function cacheNodePreviewResourceArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return cacheNodePreviewResourceSerializer(item); + }); +} + +export function cacheNodePreviewResourceArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return cacheNodePreviewResourceDeserializer(item); + }); +} + +/** ConnectedCache Resource. Represents the high level Nodes needed to provision CacheNode and customer resources used in private preview */ +export interface EnterprisePreviewResource extends TrackedResource { + /** The resource-specific properties for this resource. */ + properties?: CacheNodeOldResponse; +} + +export function enterprisePreviewResourceSerializer(item: EnterprisePreviewResource): any { + return { + tags: item["tags"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : cacheNodeOldResponseSerializer(item["properties"]), + }; +} + +export function enterprisePreviewResourceDeserializer(item: any): EnterprisePreviewResource { + return { + tags: item["tags"], + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : cacheNodeOldResponseDeserializer(item["properties"]), + }; +} + +/** The response of a EnterprisePreviewResource list operation. */ +export interface _EnterprisePreviewResourceListResult { + /** The EnterprisePreviewResource items on this page */ + value: EnterprisePreviewResource[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _enterprisePreviewResourceListResultDeserializer( + item: any, +): _EnterprisePreviewResourceListResult { + return { + value: enterprisePreviewResourceArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function enterprisePreviewResourceArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return enterprisePreviewResourceSerializer(item); + }); +} + +export function enterprisePreviewResourceArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return enterprisePreviewResourceDeserializer(item); + }); +} + +/** A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. */ +export interface _OperationListResult { + /** The Operation items on this page */ + value: Operation[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _operationListResultDeserializer(item: any): _OperationListResult { + return { + value: operationArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function operationArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return operationDeserializer(item); + }); +} + +/** Details of a REST API operation, returned from the Resource Provider Operations API */ +export interface Operation { + /** The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" */ + readonly name?: string; + /** Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure Resource Manager/control-plane operations. */ + readonly isDataAction?: boolean; + /** Localized display information for this particular operation. */ + readonly display?: OperationDisplay; + /** The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" */ + readonly origin?: Origin; + /** Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ + actionType?: ActionType; +} + +export function operationDeserializer(item: any): Operation { + return { + name: item["name"], + isDataAction: item["isDataAction"], + display: !item["display"] ? item["display"] : operationDisplayDeserializer(item["display"]), + origin: item["origin"], + actionType: item["actionType"], + }; +} + +/** Localized display information for and operation. */ +export interface OperationDisplay { + /** The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". */ + readonly provider?: string; + /** The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". */ + readonly resource?: string; + /** The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". */ + readonly operation?: string; + /** The short, localized friendly description of the operation; suitable for tool tips and detailed views. */ + readonly description?: string; +} + +export function operationDisplayDeserializer(item: any): OperationDisplay { + return { + provider: item["provider"], + resource: item["resource"], + operation: item["operation"], + description: item["description"], + }; +} + +/** Known values of {@link Origin} that the service accepts. */ +export enum KnownOrigin { + /** user */ + User = "user", + /** system */ + System = "system", + /** user,system */ + UserSystem = "user,system", +} + +/** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" \ + * {@link KnownOrigin} can be used interchangeably with Origin, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **user** \ + * **system** \ + * **user,system** + */ +export type Origin = string; + +/** Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ +export enum KnownActionType { + /** Actions are for internal-only APIs. */ + Internal = "Internal", +} + +/** + * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. \ + * {@link KnownActionType} can be used interchangeably with ActionType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Internal**: Actions are for internal-only APIs. + */ +export type ActionType = string; + +/** The available API versions. */ +export enum KnownVersions { + /** Microsoft Connected Cache Rest Api version 2023-05-01-preview */ + v2023_05_01_preview = "2023-05-01-preview", +} diff --git a/sdk/connectedcache/arm-connectedcache/src/restorePollerHelpers.ts b/sdk/connectedcache/arm-connectedcache/src/restorePollerHelpers.ts new file mode 100644 index 00000000000..0ea35ff9340 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/src/restorePollerHelpers.ts @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ConnectedCacheClient } from "./connectedCacheClient.js"; +import { _enterpriseCustomerOperationsCreateOrUpdateDeserialize } from "./api/enterpriseCustomerOperations/index.js"; +import { _cacheNodesOperationsCreateorUpdateDeserialize } from "./api/cacheNodesOperations/index.js"; +import { + _ispCustomersCreateOrUpdateDeserialize, + _ispCustomersDeleteDeserialize, +} from "./api/ispCustomers/index.js"; +import { + _ispCacheNodesOperationsCreateOrUpdateDeserialize, + _ispCacheNodesOperationsDeleteDeserialize, +} from "./api/ispCacheNodesOperations/index.js"; +import { + _enterpriseMccCustomersCreateOrUpdateDeserialize, + _enterpriseMccCustomersDeleteDeserialize, +} from "./api/enterpriseMccCustomers/index.js"; +import { + _enterpriseMccCacheNodesOperationsCreateOrUpdateDeserialize, + _enterpriseMccCacheNodesOperationsDeleteDeserialize, +} from "./api/enterpriseMccCacheNodesOperations/index.js"; +import { getLongRunningPoller } from "./static-helpers/pollingHelpers.js"; +import { OperationOptions, PathUncheckedResponse } from "@azure-rest/core-client"; +import { AbortSignalLike } from "@azure/abort-controller"; +import { + PollerLike, + OperationState, + deserializeState, + ResourceLocationConfig, +} from "@azure/core-lro"; + +export interface RestorePollerOptions< + TResult, + TResponse extends PathUncheckedResponse = PathUncheckedResponse, +> extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** + * The signal which can be used to abort requests. + */ + abortSignal?: AbortSignalLike; + /** Deserialization function for raw response body */ + processResponseBody?: (result: TResponse) => Promise; +} + +/** + * Creates a poller from the serialized state of another poller. This can be + * useful when you want to create pollers on a different host or a poller + * needs to be constructed after the original one is not in scope. + */ +export function restorePoller( + client: ConnectedCacheClient, + serializedState: string, + sourceOperation: (...args: any[]) => PollerLike, TResult>, + options?: RestorePollerOptions, +): PollerLike, TResult> { + const pollerConfig = deserializeState(serializedState).config; + const { initialRequestUrl, requestMethod, metadata } = pollerConfig; + if (!initialRequestUrl || !requestMethod) { + throw new Error( + `Invalid serialized state: ${serializedState} for sourceOperation ${sourceOperation?.name}`, + ); + } + const resourceLocationConfig = metadata?.["resourceLocationConfig"] as + | ResourceLocationConfig + | undefined; + const { deserializer, expectedStatuses = [] } = + getDeserializationHelper(initialRequestUrl, requestMethod) ?? {}; + const deserializeHelper = options?.processResponseBody ?? deserializer; + if (!deserializeHelper) { + throw new Error( + `Please ensure the operation is in this client! We can't find its deserializeHelper for ${sourceOperation?.name}.`, + ); + } + return getLongRunningPoller( + (client as any)["_client"] ?? client, + deserializeHelper as (result: TResponse) => Promise, + expectedStatuses, + { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + resourceLocationConfig, + restoreFrom: serializedState, + initialRequestUrl, + }, + ); +} + +interface DeserializationHelper { + deserializer: Function; + expectedStatuses: string[]; +} + +const deserializeMap: Record = { + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseCustomers/{customerResourceName}": + { + deserializer: _enterpriseCustomerOperationsCreateOrUpdateDeserialize, + expectedStatuses: ["200", "201"], + }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/cacheNodes/{customerResourceName}": + { + deserializer: _cacheNodesOperationsCreateorUpdateDeserialize, + expectedStatuses: ["200", "201"], + }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}": + { + deserializer: _ispCustomersCreateOrUpdateDeserialize, + expectedStatuses: ["200", "201"], + }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}": + { + deserializer: _ispCustomersDeleteDeserialize, + expectedStatuses: ["202", "204", "200"], + }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}/ispCacheNodes/{cacheNodeResourceName}": + { + deserializer: _ispCacheNodesOperationsCreateOrUpdateDeserialize, + expectedStatuses: ["200", "201"], + }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}/ispCacheNodes/{cacheNodeResourceName}": + { + deserializer: _ispCacheNodesOperationsDeleteDeserialize, + expectedStatuses: ["202", "204", "200"], + }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}": + { + deserializer: _enterpriseMccCustomersCreateOrUpdateDeserialize, + expectedStatuses: ["200", "201"], + }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}": + { + deserializer: _enterpriseMccCustomersDeleteDeserialize, + expectedStatuses: ["202", "204", "200"], + }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}/enterpriseMccCacheNodes/{cacheNodeResourceName}": + { + deserializer: _enterpriseMccCacheNodesOperationsCreateOrUpdateDeserialize, + expectedStatuses: ["200", "201"], + }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}/enterpriseMccCacheNodes/{cacheNodeResourceName}": + { + deserializer: _enterpriseMccCacheNodesOperationsDeleteDeserialize, + expectedStatuses: ["202", "204", "200"], + }, +}; + +function getDeserializationHelper( + urlStr: string, + method: string, +): DeserializationHelper | undefined { + const path = new URL(urlStr).pathname; + const pathParts = path.split("/"); + + // Traverse list to match the longest candidate + // matchedLen: the length of candidate path + // matchedValue: the matched status code array + let matchedLen = -1, + matchedValue: DeserializationHelper | undefined; + + // Iterate the responseMap to find a match + for (const [key, value] of Object.entries(deserializeMap)) { + // Extracting the path from the map key which is in format + // GET /path/foo + if (!key.startsWith(method)) { + continue; + } + const candidatePath = getPathFromMapKey(key); + // Get each part of the url path + const candidateParts = candidatePath.split("/"); + + // track if we have found a match to return the values found. + let found = true; + for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) { + if (candidateParts[i]?.startsWith("{") && candidateParts[i]?.indexOf("}") !== -1) { + const start = candidateParts[i]!.indexOf("}") + 1, + end = candidateParts[i]?.length; + // If the current part of the candidate is a "template" part + // Try to use the suffix of pattern to match the path + // {guid} ==> $ + // {guid}:export ==> :export$ + const isMatched = new RegExp(`${candidateParts[i]?.slice(start, end)}`).test( + pathParts[j] || "", + ); + + if (!isMatched) { + found = false; + break; + } + continue; + } + + // If the candidate part is not a template and + // the parts don't match mark the candidate as not found + // to move on with the next candidate path. + if (candidateParts[i] !== pathParts[j]) { + found = false; + break; + } + } + + // We finished evaluating the current candidate parts + // Update the matched value if and only if we found the longer pattern + if (found && candidatePath.length > matchedLen) { + matchedLen = candidatePath.length; + matchedValue = value; + } + } + + return matchedValue; +} + +function getPathFromMapKey(mapKey: string): string { + const pathStart = mapKey.indexOf("/"); + return mapKey.slice(pathStart); +} diff --git a/sdk/connectedcache/arm-connectedcache/src/static-helpers/pagingHelpers.ts b/sdk/connectedcache/arm-connectedcache/src/static-helpers/pagingHelpers.ts new file mode 100644 index 00000000000..ce33af5f417 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/src/static-helpers/pagingHelpers.ts @@ -0,0 +1,241 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { Client, createRestError, PathUncheckedResponse } from "@azure-rest/core-client"; +import { RestError } from "@azure/core-rest-pipeline"; + +/** + * Options for the byPage method + */ +export interface PageSettings { + /** + * A reference to a specific page to start iterating from. + */ + continuationToken?: string; +} + +/** + * An interface that describes a page of results. + */ +export type ContinuablePage = TPage & { + /** + * The token that keeps track of where to continue the iterator + */ + continuationToken?: string; +}; + +/** + * An interface that allows async iterable iteration both to completion and by page. + */ +export interface PagedAsyncIterableIterator< + TElement, + TPage = TElement[], + TPageSettings extends PageSettings = PageSettings, +> { + /** + * The next method, part of the iteration protocol + */ + next(): Promise>; + /** + * The connection to the async iterator, part of the iteration protocol + */ + [Symbol.asyncIterator](): PagedAsyncIterableIterator; + /** + * Return an AsyncIterableIterator that works a page at a time + */ + byPage: (settings?: TPageSettings) => AsyncIterableIterator>; +} + +/** + * An interface that describes how to communicate with the service. + */ +export interface PagedResult< + TElement, + TPage = TElement[], + TPageSettings extends PageSettings = PageSettings, +> { + /** + * Link to the first page of results. + */ + firstPageLink?: string; + /** + * A method that returns a page of results. + */ + getPage: (pageLink?: string) => Promise<{ page: TPage; nextPageLink?: string } | undefined>; + /** + * a function to implement the `byPage` method on the paged async iterator. + */ + byPage?: (settings?: TPageSettings) => AsyncIterableIterator>; + + /** + * A function to extract elements from a page. + */ + toElements?: (page: TPage) => TElement[]; +} + +/** + * Options for the paging helper + */ +export interface BuildPagedAsyncIteratorOptions { + itemName?: string; + nextLinkName?: string; +} + +/** + * Helper to paginate results in a generic way and return a PagedAsyncIterableIterator + */ +export function buildPagedAsyncIterator< + TElement, + TPage = TElement[], + TPageSettings extends PageSettings = PageSettings, + TResponse extends PathUncheckedResponse = PathUncheckedResponse, +>( + client: Client, + getInitialResponse: () => PromiseLike, + processResponseBody: (result: TResponse) => PromiseLike, + expectedStatuses: string[], + options: BuildPagedAsyncIteratorOptions = {}, +): PagedAsyncIterableIterator { + const itemName = options.itemName ?? "value"; + const nextLinkName = options.nextLinkName ?? "nextLink"; + const pagedResult: PagedResult = { + getPage: async (pageLink?: string) => { + const result = + pageLink === undefined + ? await getInitialResponse() + : await client.pathUnchecked(pageLink).get(); + checkPagingRequest(result, expectedStatuses); + const results = await processResponseBody(result as TResponse); + const nextLink = getNextLink(results, nextLinkName); + const values = getElements(results, itemName) as TPage; + return { + page: values, + nextPageLink: nextLink, + }; + }, + byPage: (settings?: TPageSettings) => { + const { continuationToken } = settings ?? {}; + return getPageAsyncIterator(pagedResult, { + pageLink: continuationToken, + }); + }, + }; + return getPagedAsyncIterator(pagedResult); +} + +/** + * returns an async iterator that iterates over results. It also has a `byPage` + * method that returns pages of items at once. + * + * @param pagedResult - an object that specifies how to get pages. + * @returns a paged async iterator that iterates over results. + */ + +function getPagedAsyncIterator< + TElement, + TPage = TElement[], + TPageSettings extends PageSettings = PageSettings, +>( + pagedResult: PagedResult, +): PagedAsyncIterableIterator { + const iter = getItemAsyncIterator(pagedResult); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: + pagedResult?.byPage ?? + ((settings?: TPageSettings) => { + const { continuationToken } = settings ?? {}; + return getPageAsyncIterator(pagedResult, { + pageLink: continuationToken, + }); + }), + }; +} + +async function* getItemAsyncIterator( + pagedResult: PagedResult, +): AsyncIterableIterator { + const pages = getPageAsyncIterator(pagedResult); + for await (const page of pages) { + yield* page as unknown as TElement[]; + } +} + +async function* getPageAsyncIterator( + pagedResult: PagedResult, + options: { + pageLink?: string; + } = {}, +): AsyncIterableIterator> { + const { pageLink } = options; + let response = await pagedResult.getPage(pageLink ?? pagedResult.firstPageLink); + if (!response) { + return; + } + let result = response.page as ContinuablePage; + result.continuationToken = response.nextPageLink; + yield result; + while (response.nextPageLink) { + response = await pagedResult.getPage(response.nextPageLink); + if (!response) { + return; + } + result = response.page as ContinuablePage; + result.continuationToken = response.nextPageLink; + yield result; + } +} + +/** + * Gets for the value of nextLink in the body + */ +function getNextLink(body: unknown, nextLinkName?: string): string | undefined { + if (!nextLinkName) { + return undefined; + } + + const nextLink = (body as Record)[nextLinkName]; + + if (typeof nextLink !== "string" && typeof nextLink !== "undefined" && nextLink !== null) { + throw new RestError( + `Body Property ${nextLinkName} should be a string or undefined or null but got ${typeof nextLink}`, + ); + } + + if (nextLink === null) { + return undefined; + } + + return nextLink; +} + +/** + * Gets the elements of the current request in the body. + */ +function getElements(body: unknown, itemName: string): T[] { + const value = (body as Record)[itemName] as T[]; + if (!Array.isArray(value)) { + throw new RestError( + `Couldn't paginate response\n Body doesn't contain an array property with name: ${itemName}`, + ); + } + + return value ?? []; +} + +/** + * Checks if a request failed + */ +function checkPagingRequest(response: PathUncheckedResponse, expectedStatuses: string[]): void { + if (!expectedStatuses.includes(response.status)) { + throw createRestError( + `Pagination failed with unexpected statusCode ${response.status}`, + response, + ); + } +} diff --git a/sdk/connectedcache/arm-connectedcache/src/static-helpers/pollingHelpers.ts b/sdk/connectedcache/arm-connectedcache/src/static-helpers/pollingHelpers.ts new file mode 100644 index 00000000000..f01c41bab69 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/src/static-helpers/pollingHelpers.ts @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { + PollerLike, + OperationState, + ResourceLocationConfig, + RunningOperation, + createHttpPoller, + OperationResponse, +} from "@azure/core-lro"; + +import { Client, PathUncheckedResponse, createRestError } from "@azure-rest/core-client"; +import { AbortSignalLike } from "@azure/abort-controller"; + +export interface GetLongRunningPollerOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** + * The signal which can be used to abort requests. + */ + abortSignal?: AbortSignalLike; + /** + * The potential location of the result of the LRO if specified by the LRO extension in the swagger. + */ + resourceLocationConfig?: ResourceLocationConfig; + /** + * The original url of the LRO + * Should not be null when restoreFrom is set + */ + initialRequestUrl?: string; + /** + * A serialized poller which can be used to resume an existing paused Long-Running-Operation. + */ + restoreFrom?: string; + /** + * The function to get the initial response + */ + getInitialResponse?: () => PromiseLike; +} +export function getLongRunningPoller( + client: Client, + processResponseBody: (result: TResponse) => Promise, + expectedStatuses: string[], + options: GetLongRunningPollerOptions, +): PollerLike, TResult> { + const { restoreFrom, getInitialResponse } = options; + if (!restoreFrom && !getInitialResponse) { + throw new Error("Either restoreFrom or getInitialResponse must be specified"); + } + let initialResponse: TResponse | undefined = undefined; + const pollAbortController = new AbortController(); + const poller: RunningOperation = { + sendInitialRequest: async () => { + if (!getInitialResponse) { + throw new Error("getInitialResponse is required when initializing a new poller"); + } + initialResponse = await getInitialResponse(); + return getLroResponse(initialResponse, expectedStatuses); + }, + sendPollRequest: async ( + path: string, + pollOptions?: { + abortSignal?: AbortSignalLike; + }, + ) => { + // The poll request would both listen to the user provided abort signal and the poller's own abort signal + function abortListener(): void { + pollAbortController.abort(); + } + const abortSignal = pollAbortController.signal; + if (options.abortSignal?.aborted) { + pollAbortController.abort(); + } else if (pollOptions?.abortSignal?.aborted) { + pollAbortController.abort(); + } else if (!abortSignal.aborted) { + options.abortSignal?.addEventListener("abort", abortListener, { + once: true, + }); + pollOptions?.abortSignal?.addEventListener("abort", abortListener, { + once: true, + }); + } + let response; + try { + response = await client.pathUnchecked(path).get({ abortSignal }); + } finally { + options.abortSignal?.removeEventListener("abort", abortListener); + pollOptions?.abortSignal?.removeEventListener("abort", abortListener); + } + + return getLroResponse(response as TResponse, expectedStatuses); + }, + }; + return createHttpPoller(poller, { + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: options?.resourceLocationConfig, + restoreFrom: options?.restoreFrom, + processResult: (result: unknown) => { + return processResponseBody(result as TResponse); + }, + }); +} +/** + * Converts a Rest Client response to a response that the LRO implementation understands + * @param response - a rest client http response + * @param deserializeFn - deserialize function to convert Rest response to modular output + * @returns - An LRO response that the LRO implementation understands + */ +function getLroResponse( + response: TResponse, + expectedStatuses: string[], +): OperationResponse { + if (!expectedStatuses.includes(response.status)) { + throw createRestError(response); + } + + return { + flatResponse: response, + rawResponse: { + ...response, + statusCode: Number.parseInt(response.status), + body: response.body, + }, + }; +} diff --git a/sdk/connectedcache/arm-connectedcache/test/public/connectedcache_operations_test.spec.ts b/sdk/connectedcache/arm-connectedcache/test/public/connectedcache_operations_test.spec.ts new file mode 100644 index 00000000000..d57c283c7e5 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/test/public/connectedcache_operations_test.spec.ts @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { env, Recorder, isPlaybackMode } from "@azure-tools/test-recorder"; +import { createTestCredential } from "@azure-tools/test-credential"; +import { assert, beforeEach, afterEach, it, describe } from "vitest"; +import { createRecorder } from "./utils/recordedClient.js"; +import { ConnectedCacheClient } from "../../src/connectedCacheClient.js"; + +export const testPollingOptions = { + updateIntervalInMs: isPlaybackMode() ? 0 : undefined, +}; + +describe("ConnectedCache test", () => { + let recorder: Recorder; + let subscriptionId: string; + let client: ConnectedCacheClient; + + beforeEach(async (context) => { + process.env.SystemRoot = process.env.SystemRoot || "C:\\Windows"; + recorder = await createRecorder(context); + subscriptionId = env.SUBSCRIPTION_ID || ""; + // This is an example of how the environment variables are used + const credential = createTestCredential(); + client = new ConnectedCacheClient( + credential, + subscriptionId, + recorder.configureClientOptions({}), + ); + }); + + afterEach(async function () { + await recorder.stop(); + }); + it("operations list test", async function () { + const resArray = new Array(); + for await (let item of client.operations.list()) { + resArray.push(item); + } + assert.notEqual(resArray.length, 0); + }); +}); diff --git a/sdk/connectedcache/arm-connectedcache/test/public/utils/recordedClient.ts b/sdk/connectedcache/arm-connectedcache/test/public/utils/recordedClient.ts new file mode 100644 index 00000000000..14dcd9fa397 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/test/public/utils/recordedClient.ts @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { Recorder, RecorderStartOptions, VitestTestContext } from "@azure-tools/test-recorder"; + +const replaceableVariables: Record = { + SUBSCRIPTION_ID: "azure_subscription_id", +}; + +const recorderEnvSetup: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables, +}; + +/** + * creates the recorder and reads the environment variables from the `.env` file. + * Should be called first in the test suite to make sure environment variables are + * read before they are being used. + */ +export async function createRecorder(context: VitestTestContext): Promise { + const recorder = new Recorder(context); + await recorder.start(recorderEnvSetup); + return recorder; +} diff --git a/sdk/connectedcache/arm-connectedcache/tsconfig.browser.config.json b/sdk/connectedcache/arm-connectedcache/tsconfig.browser.config.json new file mode 100644 index 00000000000..091177fcb99 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/tsconfig.browser.config.json @@ -0,0 +1,10 @@ +{ + "extends": "./.tshy/build.json", + "include": ["src/**/*.ts", "src/**/*.mts", "test/**/*.spec.ts"], + "exclude": ["test/**/node/**/*.ts"], + "compilerOptions": { + "outDir": "./dist-test/browser", + "rootDir": ".", + "skipLibCheck": true + } +} diff --git a/sdk/connectedcache/arm-connectedcache/tsconfig.json b/sdk/connectedcache/arm-connectedcache/tsconfig.json new file mode 100644 index 00000000000..b9014fa1b76 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/tsconfig.json @@ -0,0 +1,18 @@ +{ + "extends": "../../../tsconfig", + "compilerOptions": { + "module": "NodeNext", + "moduleResolution": "NodeNext", + "rootDir": ".", + "skipLibCheck": true, + "paths": { "@azure/arm-connectedcache": ["./src/index"] } + }, + "include": [ + "src/**/*.ts", + "src/**/*.mts", + "src/**/*.cts", + "test/**/*.ts", + "test/**/*.ts", + "samples-dev/**/*.ts" + ] +} diff --git a/sdk/connectedcache/arm-connectedcache/tsp-location.yaml b/sdk/connectedcache/arm-connectedcache/tsp-location.yaml new file mode 100644 index 00000000000..ddb9a7d0443 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/connectedcache/ConnectedCache.Management +commit: 60c67f112c66537f1d006bf1b497857ccd2afacd +repo: ../azure-rest-api-specs +additionalDirectories: diff --git a/sdk/connectedcache/arm-connectedcache/vitest.browser.config.ts b/sdk/connectedcache/arm-connectedcache/vitest.browser.config.ts new file mode 100644 index 00000000000..da68c1d231a --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/vitest.browser.config.ts @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { defineConfig } from "vitest/config"; +import { relativeRecordingsPath } from "@azure-tools/test-recorder"; + +process.env.RECORDINGS_RELATIVE_PATH = relativeRecordingsPath(); + +export default defineConfig({ + define: { + "process.env": process.env, + }, + test: { + reporters: ["basic", "junit"], + outputFile: { + junit: "test-results.browser.xml", + }, + browser: { + enabled: true, + headless: true, + name: "chromium", + provider: "playwright", + }, + fakeTimers: { + toFake: ["setTimeout", "Date"], + }, + watch: false, + include: ["dist-test/browser/**/*.spec.js"], + coverage: { + include: ["dist-test/browser/**/*.spec.js"], + provider: "istanbul", + reporter: ["text", "json", "html"], + reportsDirectory: "coverage-browser", + }, + testTimeout: 1200000, + hookTimeout: 1200000, + }, +}); diff --git a/sdk/connectedcache/arm-connectedcache/vitest.config.ts b/sdk/connectedcache/arm-connectedcache/vitest.config.ts new file mode 100644 index 00000000000..2cf5d0e02c2 --- /dev/null +++ b/sdk/connectedcache/arm-connectedcache/vitest.config.ts @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { defineConfig } from "vitest/config"; +import { relativeRecordingsPath } from "@azure-tools/test-recorder"; + +export default defineConfig({ + test: { + reporters: ["basic", "junit"], + outputFile: { + junit: "test-results.browser.xml", + }, + fakeTimers: { + toFake: ["setTimeout", "Date"], + }, + watch: false, + include: ["test/**/*.spec.ts"], + exclude: ["test/**/browser/*.spec.ts"], + coverage: { + include: ["src/**/*.ts"], + exclude: [ + "src/**/*-browser.mts", + "src/**/*-react-native.mts", + "vitest*.config.ts", + "samples-dev/**/*.ts", + ], + provider: "istanbul", + reporter: ["text", "json", "html"], + reportsDirectory: "coverage", + }, + testTimeout: 1200000, + hookTimeout: 1200000, + }, +}); diff --git a/sdk/connectedcache/ci.mgmt.yml b/sdk/connectedcache/ci.mgmt.yml new file mode 100644 index 00000000000..e2071197a70 --- /dev/null +++ b/sdk/connectedcache/ci.mgmt.yml @@ -0,0 +1,32 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - release/* + - hotfix/* + paths: + include: + - sdk/connectedcache/ci.mgmt.yml + - sdk/connectedcache/arm-connectedcache +pr: + branches: + include: + - main + - feature/* + - release/* + - hotfix/* + exclude: + - feature/v4 + paths: + include: + - sdk/connectedcache/ci.mgmt.yml + - sdk/connectedcache/arm-connectedcache +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: connectedcache + Artifacts: + - name: azure-arm-connectedcache + safeName: azurearmconnectedcache