diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index de0e57f7e6b..bd49448b0fb 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -2630,7 +2630,7 @@ packages: version: 0.0.0 '@rush-temp/arm-appservice-1@file:projects/arm-appservice-1.tgz': - resolution: {integrity: sha512-Wf2DGnB77ljft54tdBoZhlLGQhB6O2F35XAAYy1KcThUb5dOK3ako6dRdqKVtEBtfiEfIxgEwVxtDuqcC/M6sQ==, tarball: file:projects/arm-appservice-1.tgz} + resolution: {integrity: sha512-7U1LriKYfQx+hBmFakiSI41P3wZaiOMMdTfojoO8IjOE0hWRLmUONuVzk2eOmpKAqCAWsshc/FY9Tkk649HQLw==, tarball: file:projects/arm-appservice-1.tgz} version: 0.0.0 '@rush-temp/arm-appservice-profile-2020-09-01-hybrid@file:projects/arm-appservice-profile-2020-09-01-hybrid.tgz': @@ -3218,7 +3218,7 @@ packages: version: 0.0.0 '@rush-temp/arm-networkcloud@file:projects/arm-networkcloud.tgz': - resolution: {integrity: sha512-Vget+Btjm5TB3NqDnubucSSFQxs2rp+rX5CQ9tIQ/m6vPwVTd8blkJ6IUqSIVsxxpgrFEhsJ8cbHbOwEuJ1dlA==, tarball: file:projects/arm-networkcloud.tgz} + resolution: {integrity: sha512-VhAlzN09Jw7ZFw8pdEML1m6X5WzGMXiopKrdfQ2Bou2XDD/mncjuIV0MCrYIFQFcVKvaame0Xh9qH+HIW9VWdA==, tarball: file:projects/arm-networkcloud.tgz} version: 0.0.0 '@rush-temp/arm-networkfunction@file:projects/arm-networkfunction.tgz': @@ -3230,7 +3230,7 @@ packages: version: 0.0.0 '@rush-temp/arm-nginx@file:projects/arm-nginx.tgz': - resolution: {integrity: sha512-0Zr+dEe7RW/QTtMzMKwynKxi9E2O8VUD7A4wPGxh/ehH5g11ea4Ay97Li0k/v4HCiizyeLRkXc0SC0bWuoeZxg==, tarball: file:projects/arm-nginx.tgz} + resolution: {integrity: sha512-T2JX94sR7Z2fyia9XglIcbr8Rx3o0M97D71+1xkmHlz1K/yqnGo/QyXhKo84lZMWC2voB2XxzjmpEPftoDHhxg==, tarball: file:projects/arm-nginx.tgz} version: 0.0.0 '@rush-temp/arm-notificationhubs@file:projects/arm-notificationhubs.tgz': @@ -23783,7 +23783,7 @@ snapshots: '@types/chai-as-promised@7.1.8': dependencies: - '@types/chai': 4.3.20 + '@types/chai': 5.0.1 '@types/chai-as-promised@8.0.1': dependencies: diff --git a/sdk/appservice/arm-appservice/CHANGELOG.md b/sdk/appservice/arm-appservice/CHANGELOG.md index c5808e1e269..b2a269ff93d 100644 --- a/sdk/appservice/arm-appservice/CHANGELOG.md +++ b/sdk/appservice/arm-appservice/CHANGELOG.md @@ -1,15 +1,36 @@ # Release History - -## 16.0.1 (Unreleased) - + +## 16.1.0 (2025-02-28) + ### Features Added -### Breaking Changes - -### Bugs Fixed - -### Other Changes - + - Added operation group SiteCertificates + - Added Interface ErrorPage + - Added Interface SiteCertificatesCreateOrUpdateOptionalParams + - Added Interface SiteCertificatesCreateOrUpdateSlotOptionalParams + - Added Interface SiteCertificatesDeleteOptionalParams + - Added Interface SiteCertificatesDeleteSlotOptionalParams + - Added Interface SiteCertificatesGetOptionalParams + - Added Interface SiteCertificatesGetSlotOptionalParams + - Added Interface SiteCertificatesListNextOptionalParams + - Added Interface SiteCertificatesListOptionalParams + - Added Interface SiteCertificatesListSlotNextOptionalParams + - Added Interface SiteCertificatesListSlotOptionalParams + - Added Interface SiteCertificatesUpdateOptionalParams + - Added Interface SiteCertificatesUpdateSlotOptionalParams + - Added Type Alias SiteCertificatesCreateOrUpdateResponse + - Added Type Alias SiteCertificatesCreateOrUpdateSlotResponse + - Added Type Alias SiteCertificatesGetResponse + - Added Type Alias SiteCertificatesGetSlotResponse + - Added Type Alias SiteCertificatesListNextResponse + - Added Type Alias SiteCertificatesListResponse + - Added Type Alias SiteCertificatesListSlotNextResponse + - Added Type Alias SiteCertificatesListSlotResponse + - Added Type Alias SiteCertificatesUpdateResponse + - Added Type Alias SiteCertificatesUpdateSlotResponse + - Interface Site has a new optional parameter sshEnabled + + ## 16.0.0 (2025-02-12) ### Features Added diff --git a/sdk/appservice/arm-appservice/LICENSE b/sdk/appservice/arm-appservice/LICENSE index b2f52a2bad4..63447fd8bbb 100644 --- a/sdk/appservice/arm-appservice/LICENSE +++ b/sdk/appservice/arm-appservice/LICENSE @@ -18,4 +18,4 @@ 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. +SOFTWARE. \ No newline at end of file diff --git a/sdk/appservice/arm-appservice/README.md b/sdk/appservice/arm-appservice/README.md index a435a23c9b3..9655b87388e 100644 --- a/sdk/appservice/arm-appservice/README.md +++ b/sdk/appservice/arm-appservice/README.md @@ -47,7 +47,6 @@ You will also need to **register a new AAD application and grant access to Azure For more information about how to create an Azure AD Application check out [this guide](https://learn.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). - Using Node.js and Node-like environments, you can use the `DefaultAzureCredential` class to authenticate the client. ```ts snippet:ReadmeSampleCreateClient_Node @@ -64,16 +63,14 @@ For browser environments, use the `InteractiveBrowserCredential` from the `@azur import { InteractiveBrowserCredential } from "@azure/identity"; import { WebSiteManagementClient } from "@azure/arm-appservice"; -const subscriptionId = "00000000-0000-0000-0000-000000000000"; const credential = new InteractiveBrowserCredential({ tenantId: "", - clientId: "", -}); + clientId: "" + }); const client = new WebSiteManagementClient(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 @@ -108,7 +105,7 @@ If you'd like to contribute to this library, please read the [contributing guide - [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fappservice%2Farm-appservice%2FREADME.png) [azure_cli]: https://learn.microsoft.com/cli/azure [azure_sub]: https://azure.microsoft.com/free/ diff --git a/sdk/appservice/arm-appservice/_meta.json b/sdk/appservice/arm-appservice/_meta.json index e33dd81b951..f4829b0075b 100644 --- a/sdk/appservice/arm-appservice/_meta.json +++ b/sdk/appservice/arm-appservice/_meta.json @@ -1,8 +1,8 @@ { - "commit": "20efe6fd4db8a494eab1852a8541fbabe5de569c", + "commit": "92be5f9403660245c5088f923d62e7f0bb673661", "readme": "specification/web/resource-manager/readme.md", - "autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\web\\resource-manager\\readme.md --use=@autorest/typescript@6.0.34 --generate-sample=true", + "autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/web/resource-manager/readme.md --use=@autorest/typescript@^6.0.12", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.7.19", - "use": "@autorest/typescript@6.0.34" -} + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.21", + "use": "@autorest/typescript@^6.0.12" +} \ No newline at end of file diff --git a/sdk/appservice/arm-appservice/api-extractor.json b/sdk/appservice/arm-appservice/api-extractor.json index 1807d1dd866..8f48a64b5e1 100644 --- a/sdk/appservice/arm-appservice/api-extractor.json +++ b/sdk/appservice/arm-appservice/api-extractor.json @@ -1,6 +1,6 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "dist/esm/index.d.ts", + "mainEntryPointFilePath": "./dist-esm/src/index.d.ts", "docModel": { "enabled": true }, @@ -11,7 +11,7 @@ "dtsRollup": { "enabled": true, "untrimmedFilePath": "", - "publicTrimmedFilePath": "dist/arm-appservice.d.ts" + "publicTrimmedFilePath": "./types/arm-appservice.d.ts" }, "messages": { "tsdocMessageReporting": { @@ -28,4 +28,4 @@ } } } -} +} \ No newline at end of file diff --git a/sdk/appservice/arm-appservice/package.json b/sdk/appservice/arm-appservice/package.json index 0e720116251..307daa73bb1 100644 --- a/sdk/appservice/arm-appservice/package.json +++ b/sdk/appservice/arm-appservice/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for WebSiteManagementClient.", - "version": "16.0.1", + "version": "16.1.0", "engines": { "node": ">=18.0.0" }, @@ -21,12 +21,11 @@ "azure", "typescript", "browser", - "isomorphic", - "cloud" + "isomorphic" ], "license": "MIT", "main": "./dist/commonjs/index.js", - "module": "./dist/esm/index.js", + "module": "./dist-esm/src/index.js", "types": "./dist/commonjs/index.d.ts", "devDependencies": { "@azure-tools/test-credential": "^2.0.0", @@ -36,14 +35,17 @@ "@azure/identity": "^4.7.0", "@azure/logger": "^1.1.4", "@types/node": "^18.0.0", - "@vitest/browser": "^3.0.5", - "@vitest/coverage-istanbul": "^3.0.5", + "@vitest/browser": "^3.0.6", + "@vitest/coverage-istanbul": "^3.0.6", "dotenv": "^16.0.0", "playwright": "^1.50.1", "typescript": "~5.6.2", - "vitest": "^3.0.5" + "vitest": "^3.0.6" + }, + "repository": { + "type": "git", + "url": "https://github.com/Azure/azure-sdk-for-js.git" }, - "repository": "github:Azure/azure-sdk-for-js", "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, @@ -91,14 +93,6 @@ }, "autoPublish": true, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/appservice/arm-appservice", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://learn.microsoft.com/javascript/api/@azure/arm-appservice?view=azure-node-preview" - }, "type": "module", "tshy": { "project": "./tsconfig.src.json", @@ -139,4 +133,4 @@ } } } -} +} \ No newline at end of file diff --git a/sdk/appservice/arm-appservice/review/arm-appservice.api.md b/sdk/appservice/arm-appservice/review/arm-appservice.api.md index c9a129c4c86..df179441b32 100644 --- a/sdk/appservice/arm-appservice/review/arm-appservice.api.md +++ b/sdk/appservice/arm-appservice/review/arm-appservice.api.md @@ -3299,6 +3299,14 @@ export interface ErrorInfo { code: string; } +// @public +export interface ErrorPage { + alwaysUse?: boolean; + content?: string; + contentType?: string; + statusCode?: number; +} + // @public export interface ErrorProperties { code?: string; @@ -6005,6 +6013,7 @@ export interface Site extends Resource { siteConfig?: SiteConfig; readonly sku?: string; readonly slotSwapStatus?: SlotSwapStatus; + sshEnabled?: boolean; readonly state?: string; storageAccountRequired?: boolean; readonly suspendedTill?: Date; @@ -6073,6 +6082,98 @@ export interface SiteAuthSettingsV2 extends ProxyOnlyResource { // @public export type SiteAvailabilityState = "Normal" | "Limited" | "DisasterRecoveryMode"; +// @public +export interface SiteCertificates { + createOrUpdate(resourceGroupName: string, name: string, certificateName: string, certificateEnvelope: Certificate, options?: SiteCertificatesCreateOrUpdateOptionalParams): Promise; + createOrUpdateSlot(resourceGroupName: string, name: string, slot: string, certificateName: string, certificateEnvelope: Certificate, options?: SiteCertificatesCreateOrUpdateSlotOptionalParams): Promise; + delete(resourceGroupName: string, name: string, certificateName: string, options?: SiteCertificatesDeleteOptionalParams): Promise; + deleteSlot(resourceGroupName: string, name: string, slot: string, certificateName: string, options?: SiteCertificatesDeleteSlotOptionalParams): Promise; + get(resourceGroupName: string, name: string, certificateName: string, options?: SiteCertificatesGetOptionalParams): Promise; + getSlot(resourceGroupName: string, name: string, slot: string, certificateName: string, options?: SiteCertificatesGetSlotOptionalParams): Promise; + list(resourceGroupName: string, name: string, options?: SiteCertificatesListOptionalParams): PagedAsyncIterableIterator; + listSlot(resourceGroupName: string, name: string, slot: string, options?: SiteCertificatesListSlotOptionalParams): PagedAsyncIterableIterator; + update(resourceGroupName: string, name: string, certificateName: string, certificateEnvelope: CertificatePatchResource, options?: SiteCertificatesUpdateOptionalParams): Promise; + updateSlot(resourceGroupName: string, name: string, slot: string, certificateName: string, certificateEnvelope: CertificatePatchResource, options?: SiteCertificatesUpdateSlotOptionalParams): Promise; +} + +// @public +export interface SiteCertificatesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SiteCertificatesCreateOrUpdateResponse = Certificate; + +// @public +export interface SiteCertificatesCreateOrUpdateSlotOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SiteCertificatesCreateOrUpdateSlotResponse = Certificate; + +// @public +export interface SiteCertificatesDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface SiteCertificatesDeleteSlotOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface SiteCertificatesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SiteCertificatesGetResponse = Certificate; + +// @public +export interface SiteCertificatesGetSlotOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SiteCertificatesGetSlotResponse = Certificate; + +// @public +export interface SiteCertificatesListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SiteCertificatesListNextResponse = CertificateCollection; + +// @public +export interface SiteCertificatesListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SiteCertificatesListResponse = CertificateCollection; + +// @public +export interface SiteCertificatesListSlotNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SiteCertificatesListSlotNextResponse = CertificateCollection; + +// @public +export interface SiteCertificatesListSlotOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SiteCertificatesListSlotResponse = CertificateCollection; + +// @public +export interface SiteCertificatesUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SiteCertificatesUpdateResponse = Certificate; + +// @public +export interface SiteCertificatesUpdateSlotOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SiteCertificatesUpdateSlotResponse = Certificate; + // @public export interface SiteCloneability { blockingCharacteristics?: SiteCloneabilityCriterion[]; @@ -11944,6 +12045,8 @@ export class WebSiteManagementClient extends coreClient.ServiceClient { // (undocumented) resourceHealthMetadataOperations: ResourceHealthMetadataOperations; // (undocumented) + siteCertificates: SiteCertificates; + // (undocumented) staticSites: StaticSites; // (undocumented) subscriptionId?: string; diff --git a/sdk/appservice/arm-appservice/src/lroImpl.ts b/sdk/appservice/arm-appservice/src/lroImpl.ts index d8bc9898705..5f88efab981 100644 --- a/sdk/appservice/arm-appservice/src/lroImpl.ts +++ b/sdk/appservice/arm-appservice/src/lroImpl.ts @@ -5,6 +5,10 @@ * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + import { AbortSignalLike } from "@azure/abort-controller"; import { LongRunningOperation, LroResponse } from "@azure/core-lro"; diff --git a/sdk/appservice/arm-appservice/src/models/index.ts b/sdk/appservice/arm-appservice/src/models/index.ts index a8202ae8583..f7cdb8b07b1 100644 --- a/sdk/appservice/arm-appservice/src/models/index.ts +++ b/sdk/appservice/arm-appservice/src/models/index.ts @@ -5010,6 +5010,18 @@ export interface AppserviceGithubTokenRequest { state: string; } +/** A custom error page for a specific status returned by a web app. */ +export interface ErrorPage { + /** The status code for which the error page will be used */ + statusCode?: number; + /** The content of the error page. There is a 10kb limit imposed on custom error page content. */ + content?: string; + /** The content type of the error page. For example, 'text/html' */ + contentType?: string; + /** If true, the error page will be shown for all requests with a matching status code, regardless of whether they failed on the App Service FrontEnd load balancer or on the app itself. */ + alwaysUse?: boolean; +} + /** The workflow filter. */ export interface WorkflowFilter { /** The state of workflows. */ @@ -5386,6 +5398,8 @@ export interface Site extends Resource { ipMode?: IPMode; /** Whether to use end to end encryption between the FrontEnd and the Worker */ endToEndEncryptionEnabled?: boolean; + /** Whether to enable ssh access. */ + sshEnabled?: boolean; /** * true to disable the public hostnames of the app; otherwise, false. * If true, the app is only accessible via API management process. @@ -5626,16 +5640,16 @@ export interface Certificate extends Resource { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly hostingEnvironmentProfile?: HostingEnvironmentProfile; - /** Key Vault Csm resource Id. */ + /** Azure Key Vault Csm resource Id. */ keyVaultId?: string; - /** Key Vault secret name. */ + /** Azure Key Vault secret name. */ keyVaultSecretName?: string; /** * Status of the Key Vault secret. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly keyVaultSecretStatus?: KeyVaultSecretStatus; - /** Resource ID of the associated App Service plan, formatted as: "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". */ + /** Resource ID of the associated App Service plan. */ serverFarmId?: string; /** CNAME of the certificate to be issued via free certificate */ canonicalName?: string; @@ -13224,6 +13238,84 @@ export interface GetUsagesInLocationListNextOptionalParams /** Contains response data for the listNext operation. */ export type GetUsagesInLocationListNextResponse = CsmUsageQuotaCollection; +/** Optional parameters. */ +export interface SiteCertificatesListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type SiteCertificatesListResponse = CertificateCollection; + +/** Optional parameters. */ +export interface SiteCertificatesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type SiteCertificatesGetResponse = Certificate; + +/** Optional parameters. */ +export interface SiteCertificatesCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createOrUpdate operation. */ +export type SiteCertificatesCreateOrUpdateResponse = Certificate; + +/** Optional parameters. */ +export interface SiteCertificatesDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface SiteCertificatesUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the update operation. */ +export type SiteCertificatesUpdateResponse = Certificate; + +/** Optional parameters. */ +export interface SiteCertificatesListSlotOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listSlot operation. */ +export type SiteCertificatesListSlotResponse = CertificateCollection; + +/** Optional parameters. */ +export interface SiteCertificatesGetSlotOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getSlot operation. */ +export type SiteCertificatesGetSlotResponse = Certificate; + +/** Optional parameters. */ +export interface SiteCertificatesCreateOrUpdateSlotOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createOrUpdateSlot operation. */ +export type SiteCertificatesCreateOrUpdateSlotResponse = Certificate; + +/** Optional parameters. */ +export interface SiteCertificatesDeleteSlotOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface SiteCertificatesUpdateSlotOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the updateSlot operation. */ +export type SiteCertificatesUpdateSlotResponse = Certificate; + +/** Optional parameters. */ +export interface SiteCertificatesListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type SiteCertificatesListNextResponse = CertificateCollection; + +/** Optional parameters. */ +export interface SiteCertificatesListSlotNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listSlotNext operation. */ +export type SiteCertificatesListSlotNextResponse = CertificateCollection; + /** Optional parameters. */ export interface StaticSitesPreviewWorkflowOptionalParams extends coreClient.OperationOptions {} diff --git a/sdk/appservice/arm-appservice/src/models/mappers.ts b/sdk/appservice/arm-appservice/src/models/mappers.ts index 08302eb3d90..6e8d5d79bc0 100644 --- a/sdk/appservice/arm-appservice/src/models/mappers.ts +++ b/sdk/appservice/arm-appservice/src/models/mappers.ts @@ -15130,6 +15130,44 @@ export const AppserviceGithubTokenRequest: coreClient.CompositeMapper = { }, }; +export const ErrorPage: coreClient.CompositeMapper = { + serializedName: "ErrorPage", + type: { + name: "Composite", + className: "ErrorPage", + modelProperties: { + statusCode: { + serializedName: "statusCode", + xmlName: "statusCode", + type: { + name: "Number", + }, + }, + content: { + serializedName: "content", + xmlName: "content", + type: { + name: "String", + }, + }, + contentType: { + serializedName: "contentType", + xmlName: "contentType", + type: { + name: "String", + }, + }, + alwaysUse: { + serializedName: "alwaysUse", + xmlName: "alwaysUse", + type: { + name: "Boolean", + }, + }, + }, + }, +}; + export const WorkflowFilter: coreClient.CompositeMapper = { serializedName: "WorkflowFilter", type: { @@ -16193,6 +16231,13 @@ export const Site: coreClient.CompositeMapper = { name: "Boolean", }, }, + sshEnabled: { + serializedName: "properties.sshEnabled", + xmlName: "properties.sshEnabled", + type: { + name: "Boolean", + }, + }, hostNamesDisabled: { serializedName: "properties.hostNamesDisabled", xmlName: "properties.hostNamesDisabled", diff --git a/sdk/appservice/arm-appservice/src/models/parameters.ts b/sdk/appservice/arm-appservice/src/models/parameters.ts index 6b83c2ba29f..ac0cf0c5d36 100644 --- a/sdk/appservice/arm-appservice/src/models/parameters.ts +++ b/sdk/appservice/arm-appservice/src/models/parameters.ts @@ -140,7 +140,7 @@ export const subscriptionId: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2024-04-01", + defaultValue: "2024-11-01", isConstant: true, serializedName: "api-version", type: { @@ -977,6 +977,64 @@ export const location1: OperationURLParameter = { }, }; +export const resourceGroupName1: OperationURLParameter = { + parameterPath: "resourceGroupName", + mapper: { + constraints: { + MaxLength: 90, + MinLength: 1, + }, + serializedName: "resourceGroupName", + required: true, + xmlName: "resourceGroupName", + type: { + name: "String", + }, + }, +}; + +export const name2: OperationURLParameter = { + parameterPath: "name", + mapper: { + constraints: { + Pattern: new RegExp("^[A-z][A-z0-9]*$"), + }, + serializedName: "name", + required: true, + xmlName: "name", + type: { + name: "String", + }, + }, +}; + +export const certificateName: OperationURLParameter = { + parameterPath: "certificateName", + mapper: { + constraints: { + Pattern: new RegExp("^[A-z][A-z0-9]*$"), + }, + serializedName: "certificateName", + required: true, + xmlName: "certificateName", + type: { + name: "String", + }, + }, +}; + +export const certificateName1: OperationURLParameter = { + parameterPath: "certificateName", + mapper: { + serializedName: "certificateName", + required: true, + xmlName: "certificateName", + type: { + name: "String", + }, + }, +}; + export const staticSitesWorkflowPreviewRequest: OperationParameter = { parameterPath: "staticSitesWorkflowPreviewRequest", mapper: StaticSitesWorkflowPreviewRequestMapper, diff --git a/sdk/appservice/arm-appservice/src/operations/index.ts b/sdk/appservice/arm-appservice/src/operations/index.ts index ac6566b1dd5..56a646583b8 100644 --- a/sdk/appservice/arm-appservice/src/operations/index.ts +++ b/sdk/appservice/arm-appservice/src/operations/index.ts @@ -23,6 +23,7 @@ export * from "./provider.js"; export * from "./recommendations.js"; export * from "./resourceHealthMetadataOperations.js"; export * from "./getUsagesInLocation.js"; +export * from "./siteCertificates.js"; export * from "./staticSites.js"; export * from "./webApps.js"; export * from "./workflows.js"; diff --git a/sdk/appservice/arm-appservice/src/operations/siteCertificates.ts b/sdk/appservice/arm-appservice/src/operations/siteCertificates.ts new file mode 100644 index 00000000000..a0834db4101 --- /dev/null +++ b/sdk/appservice/arm-appservice/src/operations/siteCertificates.ts @@ -0,0 +1,767 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper.js"; +import { SiteCertificates } from "../operationsInterfaces/index.js"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import { WebSiteManagementClient } from "../webSiteManagementClient.js"; +import { + Certificate, + SiteCertificatesListNextOptionalParams, + SiteCertificatesListOptionalParams, + SiteCertificatesListResponse, + SiteCertificatesListSlotNextOptionalParams, + SiteCertificatesListSlotOptionalParams, + SiteCertificatesListSlotResponse, + SiteCertificatesGetOptionalParams, + SiteCertificatesGetResponse, + SiteCertificatesCreateOrUpdateOptionalParams, + SiteCertificatesCreateOrUpdateResponse, + SiteCertificatesDeleteOptionalParams, + CertificatePatchResource, + SiteCertificatesUpdateOptionalParams, + SiteCertificatesUpdateResponse, + SiteCertificatesGetSlotOptionalParams, + SiteCertificatesGetSlotResponse, + SiteCertificatesCreateOrUpdateSlotOptionalParams, + SiteCertificatesCreateOrUpdateSlotResponse, + SiteCertificatesDeleteSlotOptionalParams, + SiteCertificatesUpdateSlotOptionalParams, + SiteCertificatesUpdateSlotResponse, + SiteCertificatesListNextResponse, + SiteCertificatesListSlotNextResponse, +} from "../models/index.js"; + +/// +/** Class containing SiteCertificates operations. */ +export class SiteCertificatesImpl implements SiteCertificates { + private readonly client: WebSiteManagementClient; + + /** + * Initialize a new instance of the class SiteCertificates class. + * @param client Reference to the service client + */ + constructor(client: WebSiteManagementClient) { + this.client = client; + } + + /** + * Get all certificates in a resource group under a site. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the site. + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + name: string, + options?: SiteCertificatesListOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceGroupName, name, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage(resourceGroupName, name, options, settings); + }, + }; + } + + private async *listPagingPage( + resourceGroupName: string, + name: string, + options?: SiteCertificatesListOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: SiteCertificatesListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, name, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + name, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + resourceGroupName: string, + name: string, + options?: SiteCertificatesListOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + name, + options, + )) { + yield* page; + } + } + + /** + * Get all certificates in a resource group for a given site and a deployment slot. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the site. + * @param slot Name of the deployment slot. If a slot is not specified, the API will create a binding + * for the production slot. + * @param options The options parameters. + */ + public listSlot( + resourceGroupName: string, + name: string, + slot: string, + options?: SiteCertificatesListSlotOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listSlotPagingAll(resourceGroupName, name, slot, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listSlotPagingPage( + resourceGroupName, + name, + slot, + options, + settings, + ); + }, + }; + } + + private async *listSlotPagingPage( + resourceGroupName: string, + name: string, + slot: string, + options?: SiteCertificatesListSlotOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: SiteCertificatesListSlotResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listSlot(resourceGroupName, name, slot, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listSlotNext( + resourceGroupName, + name, + slot, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listSlotPagingAll( + resourceGroupName: string, + name: string, + slot: string, + options?: SiteCertificatesListSlotOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listSlotPagingPage( + resourceGroupName, + name, + slot, + options, + )) { + yield* page; + } + } + + /** + * Get all certificates in a resource group under a site. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the site. + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + name: string, + options?: SiteCertificatesListOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, name, options }, + listOperationSpec, + ); + } + + /** + * Get a certificate belonging to a given site. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the site. + * @param certificateName Name of the certificate. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + name: string, + certificateName: string, + options?: SiteCertificatesGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, name, certificateName, options }, + getOperationSpec, + ); + } + + /** + * Create or update a certificate under a given site. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the site. + * @param certificateName Name of the certificate. + * @param certificateEnvelope Details of certificate, if it exists already. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + name: string, + certificateName: string, + certificateEnvelope: Certificate, + options?: SiteCertificatesCreateOrUpdateOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + certificateName, + certificateEnvelope, + options, + }, + createOrUpdateOperationSpec, + ); + } + + /** + * Delete a certificate from the site. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the site. + * @param certificateName Name of the certificate. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + name: string, + certificateName: string, + options?: SiteCertificatesDeleteOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, name, certificateName, options }, + deleteOperationSpec, + ); + } + + /** + * Create or update a certificate under a given site. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the site. + * @param certificateName Name of the certificate. + * @param certificateEnvelope Details of certificate, if it exists already. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + name: string, + certificateName: string, + certificateEnvelope: CertificatePatchResource, + options?: SiteCertificatesUpdateOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + certificateName, + certificateEnvelope, + options, + }, + updateOperationSpec, + ); + } + + /** + * Get all certificates in a resource group for a given site and a deployment slot. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the site. + * @param slot Name of the deployment slot. If a slot is not specified, the API will create a binding + * for the production slot. + * @param options The options parameters. + */ + private _listSlot( + resourceGroupName: string, + name: string, + slot: string, + options?: SiteCertificatesListSlotOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, name, slot, options }, + listSlotOperationSpec, + ); + } + + /** + * Get a certificate for a given site and deployment slot. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the site. + * @param slot Name of the deployment slot. If a slot is not specified, the API will create a binding + * for the production slot. + * @param certificateName Name of the certificate. + * @param options The options parameters. + */ + getSlot( + resourceGroupName: string, + name: string, + slot: string, + certificateName: string, + options?: SiteCertificatesGetSlotOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, name, slot, certificateName, options }, + getSlotOperationSpec, + ); + } + + /** + * Create or update a certificate in a given site and deployment slot. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the site. + * @param slot Name of the deployment slot. If a slot is not specified, the API will create a binding + * for the production slot. + * @param certificateName Name of the certificate. + * @param certificateEnvelope Details of certificate, if it exists already. + * @param options The options parameters. + */ + createOrUpdateSlot( + resourceGroupName: string, + name: string, + slot: string, + certificateName: string, + certificateEnvelope: Certificate, + options?: SiteCertificatesCreateOrUpdateSlotOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + certificateName, + certificateEnvelope, + options, + }, + createOrUpdateSlotOperationSpec, + ); + } + + /** + * Delete a certificate for a given site and deployment slot. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the site. + * @param slot Name of the deployment slot. If a slot is not specified, the API will create a binding + * for the production slot. + * @param certificateName Name of the certificate. + * @param options The options parameters. + */ + deleteSlot( + resourceGroupName: string, + name: string, + slot: string, + certificateName: string, + options?: SiteCertificatesDeleteSlotOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, name, slot, certificateName, options }, + deleteSlotOperationSpec, + ); + } + + /** + * Create or update a certificate for a site and deployment slot. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the site. + * @param slot Name of the deployment slot. If a slot is not specified, the API will create a binding + * for the production slot. + * @param certificateName Name of the certificate. + * @param certificateEnvelope Details of certificate, if it exists already. + * @param options The options parameters. + */ + updateSlot( + resourceGroupName: string, + name: string, + slot: string, + certificateName: string, + certificateEnvelope: CertificatePatchResource, + options?: SiteCertificatesUpdateSlotOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + certificateName, + certificateEnvelope, + options, + }, + updateSlotOperationSpec, + ); + } + + /** + * ListNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the site. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + name: string, + nextLink: string, + options?: SiteCertificatesListNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, name, nextLink, options }, + listNextOperationSpec, + ); + } + + /** + * ListSlotNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the site. + * @param slot Name of the deployment slot. If a slot is not specified, the API will create a binding + * for the production slot. + * @param nextLink The nextLink from the previous successful call to the ListSlot method. + * @param options The options parameters. + */ + private _listSlotNext( + resourceGroupName: string, + name: string, + slot: string, + nextLink: string, + options?: SiteCertificatesListSlotNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, name, slot, nextLink, options }, + listSlotNextOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/certificates", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CertificateCollection, + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName1, + Parameters.name2, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/certificates/{certificateName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Certificate, + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName1, + Parameters.name2, + Parameters.certificateName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/certificates/{certificateName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.Certificate, + }, + 201: { + bodyMapper: Mappers.Certificate, + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse, + }, + }, + requestBody: Parameters.certificateEnvelope, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName1, + Parameters.name2, + Parameters.certificateName1, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/certificates/{certificateName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.DefaultErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.name, + Parameters.resourceGroupName1, + Parameters.certificateName1, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/certificates/{certificateName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.Certificate, + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse, + }, + }, + requestBody: Parameters.certificateEnvelope1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.name, + Parameters.resourceGroupName1, + Parameters.certificateName1, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const listSlotOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/certificates", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CertificateCollection, + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.slot, + Parameters.resourceGroupName1, + Parameters.name2, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getSlotOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/certificates/{certificateName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Certificate, + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.slot, + Parameters.resourceGroupName1, + Parameters.name2, + Parameters.certificateName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const createOrUpdateSlotOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/certificates/{certificateName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.Certificate, + }, + 201: { + bodyMapper: Mappers.Certificate, + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse, + }, + }, + requestBody: Parameters.certificateEnvelope, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.name, + Parameters.slot, + Parameters.resourceGroupName1, + Parameters.certificateName1, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const deleteSlotOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/certificates/{certificateName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.DefaultErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.name, + Parameters.slot, + Parameters.resourceGroupName1, + Parameters.certificateName1, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const updateSlotOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/certificates/{certificateName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.Certificate, + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse, + }, + }, + requestBody: Parameters.certificateEnvelope1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.name, + Parameters.slot, + Parameters.resourceGroupName1, + Parameters.certificateName1, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CertificateCollection, + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink, + Parameters.resourceGroupName1, + Parameters.name2, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listSlotNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CertificateCollection, + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink, + Parameters.slot, + Parameters.resourceGroupName1, + Parameters.name2, + ], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/appservice/arm-appservice/src/operationsInterfaces/index.ts b/sdk/appservice/arm-appservice/src/operationsInterfaces/index.ts index ac6566b1dd5..56a646583b8 100644 --- a/sdk/appservice/arm-appservice/src/operationsInterfaces/index.ts +++ b/sdk/appservice/arm-appservice/src/operationsInterfaces/index.ts @@ -23,6 +23,7 @@ export * from "./provider.js"; export * from "./recommendations.js"; export * from "./resourceHealthMetadataOperations.js"; export * from "./getUsagesInLocation.js"; +export * from "./siteCertificates.js"; export * from "./staticSites.js"; export * from "./webApps.js"; export * from "./workflows.js"; diff --git a/sdk/appservice/arm-appservice/src/operationsInterfaces/siteCertificates.ts b/sdk/appservice/arm-appservice/src/operationsInterfaces/siteCertificates.ts new file mode 100644 index 00000000000..8040380ffcb --- /dev/null +++ b/sdk/appservice/arm-appservice/src/operationsInterfaces/siteCertificates.ts @@ -0,0 +1,183 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + Certificate, + SiteCertificatesListOptionalParams, + SiteCertificatesListSlotOptionalParams, + SiteCertificatesGetOptionalParams, + SiteCertificatesGetResponse, + SiteCertificatesCreateOrUpdateOptionalParams, + SiteCertificatesCreateOrUpdateResponse, + SiteCertificatesDeleteOptionalParams, + CertificatePatchResource, + SiteCertificatesUpdateOptionalParams, + SiteCertificatesUpdateResponse, + SiteCertificatesGetSlotOptionalParams, + SiteCertificatesGetSlotResponse, + SiteCertificatesCreateOrUpdateSlotOptionalParams, + SiteCertificatesCreateOrUpdateSlotResponse, + SiteCertificatesDeleteSlotOptionalParams, + SiteCertificatesUpdateSlotOptionalParams, + SiteCertificatesUpdateSlotResponse, +} from "../models/index.js"; + +/// +/** Interface representing a SiteCertificates. */ +export interface SiteCertificates { + /** + * Get all certificates in a resource group under a site. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the site. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + name: string, + options?: SiteCertificatesListOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Get all certificates in a resource group for a given site and a deployment slot. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the site. + * @param slot Name of the deployment slot. If a slot is not specified, the API will create a binding + * for the production slot. + * @param options The options parameters. + */ + listSlot( + resourceGroupName: string, + name: string, + slot: string, + options?: SiteCertificatesListSlotOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Get a certificate belonging to a given site. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the site. + * @param certificateName Name of the certificate. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + name: string, + certificateName: string, + options?: SiteCertificatesGetOptionalParams, + ): Promise; + /** + * Create or update a certificate under a given site. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the site. + * @param certificateName Name of the certificate. + * @param certificateEnvelope Details of certificate, if it exists already. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + name: string, + certificateName: string, + certificateEnvelope: Certificate, + options?: SiteCertificatesCreateOrUpdateOptionalParams, + ): Promise; + /** + * Delete a certificate from the site. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the site. + * @param certificateName Name of the certificate. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + name: string, + certificateName: string, + options?: SiteCertificatesDeleteOptionalParams, + ): Promise; + /** + * Create or update a certificate under a given site. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the site. + * @param certificateName Name of the certificate. + * @param certificateEnvelope Details of certificate, if it exists already. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + name: string, + certificateName: string, + certificateEnvelope: CertificatePatchResource, + options?: SiteCertificatesUpdateOptionalParams, + ): Promise; + /** + * Get a certificate for a given site and deployment slot. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the site. + * @param slot Name of the deployment slot. If a slot is not specified, the API will create a binding + * for the production slot. + * @param certificateName Name of the certificate. + * @param options The options parameters. + */ + getSlot( + resourceGroupName: string, + name: string, + slot: string, + certificateName: string, + options?: SiteCertificatesGetSlotOptionalParams, + ): Promise; + /** + * Create or update a certificate in a given site and deployment slot. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the site. + * @param slot Name of the deployment slot. If a slot is not specified, the API will create a binding + * for the production slot. + * @param certificateName Name of the certificate. + * @param certificateEnvelope Details of certificate, if it exists already. + * @param options The options parameters. + */ + createOrUpdateSlot( + resourceGroupName: string, + name: string, + slot: string, + certificateName: string, + certificateEnvelope: Certificate, + options?: SiteCertificatesCreateOrUpdateSlotOptionalParams, + ): Promise; + /** + * Delete a certificate for a given site and deployment slot. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the site. + * @param slot Name of the deployment slot. If a slot is not specified, the API will create a binding + * for the production slot. + * @param certificateName Name of the certificate. + * @param options The options parameters. + */ + deleteSlot( + resourceGroupName: string, + name: string, + slot: string, + certificateName: string, + options?: SiteCertificatesDeleteSlotOptionalParams, + ): Promise; + /** + * Create or update a certificate for a site and deployment slot. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the site. + * @param slot Name of the deployment slot. If a slot is not specified, the API will create a binding + * for the production slot. + * @param certificateName Name of the certificate. + * @param certificateEnvelope Details of certificate, if it exists already. + * @param options The options parameters. + */ + updateSlot( + resourceGroupName: string, + name: string, + slot: string, + certificateName: string, + certificateEnvelope: CertificatePatchResource, + options?: SiteCertificatesUpdateSlotOptionalParams, + ): Promise; +} diff --git a/sdk/appservice/arm-appservice/src/webSiteManagementClient.ts b/sdk/appservice/arm-appservice/src/webSiteManagementClient.ts index e3e2a7a4528..981c1e73903 100644 --- a/sdk/appservice/arm-appservice/src/webSiteManagementClient.ts +++ b/sdk/appservice/arm-appservice/src/webSiteManagementClient.ts @@ -34,6 +34,7 @@ import { RecommendationsImpl, ResourceHealthMetadataOperationsImpl, GetUsagesInLocationImpl, + SiteCertificatesImpl, StaticSitesImpl, WebAppsImpl, WorkflowsImpl, @@ -64,6 +65,7 @@ import { Recommendations, ResourceHealthMetadataOperations, GetUsagesInLocation, + SiteCertificates, StaticSites, WebApps, Workflows, @@ -191,7 +193,7 @@ export class WebSiteManagementClient extends coreClient.ServiceClient { credential: credentials, }; - const packageDetails = `azsdk-js-arm-appservice/16.0.1`; + const packageDetails = `azsdk-js-arm-appservice/16.1.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -245,7 +247,7 @@ export class WebSiteManagementClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2024-04-01"; + this.apiVersion = options.apiVersion || "2024-11-01"; this.appServiceCertificateOrders = new AppServiceCertificateOrdersImpl( this, ); @@ -269,6 +271,7 @@ export class WebSiteManagementClient extends coreClient.ServiceClient { this.resourceHealthMetadataOperations = new ResourceHealthMetadataOperationsImpl(this); this.getUsagesInLocation = new GetUsagesInLocationImpl(this); + this.siteCertificates = new SiteCertificatesImpl(this); this.staticSites = new StaticSitesImpl(this); this.webApps = new WebAppsImpl(this); this.workflows = new WorkflowsImpl(this); @@ -1098,6 +1101,7 @@ export class WebSiteManagementClient extends coreClient.ServiceClient { recommendations: Recommendations; resourceHealthMetadataOperations: ResourceHealthMetadataOperations; getUsagesInLocation: GetUsagesInLocation; + siteCertificates: SiteCertificates; staticSites: StaticSites; webApps: WebApps; workflows: Workflows; diff --git a/sdk/appservice/arm-appservice/test/sampleTest.ts b/sdk/appservice/arm-appservice/test/sampleTest.ts new file mode 100644 index 00000000000..a1cf7c25afd --- /dev/null +++ b/sdk/appservice/arm-appservice/test/sampleTest.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + Recorder, + RecorderStartOptions, +} from "@azure-tools/test-recorder"; + +const replaceableVariables: Record = { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id", +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables, +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async (ctx) => { + recorder = new Recorder(ctx); + await recorder.start(recorderOptions); + }); + + afterEach(async () => { + await recorder.stop(); + }); + + it("sample test", async function () { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/appservice/arm-appservice/test/snippets.spec.ts b/sdk/appservice/arm-appservice/test/snippets.spec.ts index 11dd2e26c86..5650d548912 100644 --- a/sdk/appservice/arm-appservice/test/snippets.spec.ts +++ b/sdk/appservice/arm-appservice/test/snippets.spec.ts @@ -1,15 +1,29 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import { WebSiteManagementClient } from "@azure/arm-appservice"; -import { DefaultAzureCredential, InteractiveBrowserCredential } from "@azure/identity"; +import { WebSiteManagementClient } from "../src/index.js"; +import { + DefaultAzureCredential, + InteractiveBrowserCredential, +} from "@azure/identity"; import { setLogLevel } from "@azure/logger"; import { describe, it } from "vitest"; describe("snippets", () => { it("ReadmeSampleCreateClient_Node", async () => { const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new WebSiteManagementClient(new DefaultAzureCredential(), subscriptionId); + const client = new WebSiteManagementClient( + new DefaultAzureCredential(), + subscriptionId, + ); }); it("ReadmeSampleCreateClient_Browser", async () => { diff --git a/sdk/appservice/arm-appservice/tsconfig.browser.config.json b/sdk/appservice/arm-appservice/tsconfig.browser.config.json index 75871518e3a..0c8bafa9712 100644 --- a/sdk/appservice/arm-appservice/tsconfig.browser.config.json +++ b/sdk/appservice/arm-appservice/tsconfig.browser.config.json @@ -1,3 +1,6 @@ { - "extends": ["./tsconfig.test.json", "../../../tsconfig.browser.base.json"] + "extends": [ + "./tsconfig.test.json", + "../../../tsconfig.browser.base.json" + ] } diff --git a/sdk/appservice/arm-appservice/tsconfig.json b/sdk/appservice/arm-appservice/tsconfig.json index 19ceb382b52..b35d05ad6e9 100644 --- a/sdk/appservice/arm-appservice/tsconfig.json +++ b/sdk/appservice/arm-appservice/tsconfig.json @@ -1,13 +1,27 @@ { - "references": [ - { - "path": "./tsconfig.src.json" - }, - { - "path": "./tsconfig.samples.json" - }, - { - "path": "./tsconfig.test.json" - } + "compilerOptions": { + "module": "es6", + "moduleResolution": "node", + "strict": true, + "target": "es6", + "sourceMap": true, + "declarationMap": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "lib": [ + "es6", + "dom" + ], + "declaration": true, + "outDir": "./dist-esm", + "importHelpers": true + }, + "include": [ + "src/**/*.ts", + "test/**/*.ts" + ], + "exclude": [ + "node_modules" ] -} +} \ No newline at end of file diff --git a/sdk/appservice/arm-appservice/tsconfig.samples.json b/sdk/appservice/arm-appservice/tsconfig.samples.json index 4ca8696f5d9..c8de4eac841 100644 --- a/sdk/appservice/arm-appservice/tsconfig.samples.json +++ b/sdk/appservice/arm-appservice/tsconfig.samples.json @@ -2,7 +2,9 @@ "extends": "../../../tsconfig.samples.base.json", "compilerOptions": { "paths": { - "@azure/arm-appservice": ["./dist/esm"] + "@azure/arm-appservice": [ + "./dist/esm" + ] } } } diff --git a/sdk/appservice/arm-appservice/tsconfig.test.json b/sdk/appservice/arm-appservice/tsconfig.test.json index 290ca214aeb..3c2b783a8c1 100644 --- a/sdk/appservice/arm-appservice/tsconfig.test.json +++ b/sdk/appservice/arm-appservice/tsconfig.test.json @@ -1,3 +1,6 @@ { - "extends": ["./tsconfig.src.json", "../../../tsconfig.test.base.json"] + "extends": [ + "./tsconfig.src.json", + "../../../tsconfig.test.base.json" + ] } diff --git a/sdk/appservice/arm-appservice/vitest.browser.config.ts b/sdk/appservice/arm-appservice/vitest.browser.config.ts index 10e70dbfa8e..182729ab5ce 100644 --- a/sdk/appservice/arm-appservice/vitest.browser.config.ts +++ b/sdk/appservice/arm-appservice/vitest.browser.config.ts @@ -1,3 +1,4 @@ + // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. @@ -8,7 +9,7 @@ export default mergeConfig( viteConfig, defineConfig({ test: { - include: ["dist-test/browser/test/**/*.spec.js"], + include: ["dist-test/browser/test/**/*.spec.js",], testTimeout: 1200000, hookTimeout: 1200000, }, diff --git a/sdk/appservice/arm-appservice/vitest.config.ts b/sdk/appservice/arm-appservice/vitest.config.ts index 86a71911ccc..40e031385dd 100644 --- a/sdk/appservice/arm-appservice/vitest.config.ts +++ b/sdk/appservice/arm-appservice/vitest.config.ts @@ -1,3 +1,4 @@ + // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. diff --git a/sdk/appservice/arm-appservice/vitest.esm.config.ts b/sdk/appservice/arm-appservice/vitest.esm.config.ts index 5e9735e9b14..a70127279fc 100644 --- a/sdk/appservice/arm-appservice/vitest.esm.config.ts +++ b/sdk/appservice/arm-appservice/vitest.esm.config.ts @@ -1,3 +1,4 @@ + // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. @@ -5,4 +6,7 @@ import { mergeConfig } from "vitest/config"; import vitestConfig from "./vitest.config.ts"; import vitestEsmConfig from "../../../vitest.esm.shared.config.ts"; -export default mergeConfig(vitestConfig, vitestEsmConfig); +export default mergeConfig( + vitestConfig, + vitestEsmConfig +);