diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index c1abeafa46e3..1796fb40b26d 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -15272,7 +15272,7 @@ packages: dev: false file:projects/arm-nginx.tgz: - resolution: {integrity: sha512-LoqehVB1afT29IOfLh7Qk5tO0L+Shm6R2NDTuhARtR741dNCcFgJGvcwfG15h9SoMvNE0r9dToFU1gMloGTLsw==, tarball: file:projects/arm-nginx.tgz} + resolution: {integrity: sha512-AvmU9ogVUUk92KHFeSMszUOXtcKhKd6o4499wNqRTZ5wVCARN91GDkrDCOAirTJuxYU5ZrdNOoap192IF2rfMA==, tarball: file:projects/arm-nginx.tgz} name: '@rush-temp/arm-nginx' version: 0.0.0 dependencies: @@ -16320,7 +16320,7 @@ packages: dev: false file:projects/arm-search.tgz: - resolution: {integrity: sha512-Na4arZcPzswhzF8Fi0O0+dX7HyhCx21d/zu8uDFsqF4t7vhArbxewOFnYfMWGBubDvkRslDDUKWbZOsMI/57Yw==, tarball: file:projects/arm-search.tgz} + resolution: {integrity: sha512-6ntm18pb+N3L70Pe4PWXlBLBrcPDCAVA07DPcRQZo4LbuRUbJW6+XWia/+C6smVm47xLFDt/nJF3Qj3KaXhVgA==, tarball: file:projects/arm-search.tgz} name: '@rush-temp/arm-search' version: 0.0.0 dependencies: @@ -16333,7 +16333,8 @@ packages: chai: 4.3.10 cross-env: 7.0.3 dotenv: 16.4.5 - mkdirp: 1.0.4 + esm: 3.2.25 + mkdirp: 2.1.6 mocha: 10.3.0 rimraf: 5.0.5 ts-node: 10.9.2(@types/node@18.19.24)(typescript@5.3.3) diff --git a/sdk/search/arm-search/CHANGELOG.md b/sdk/search/arm-search/CHANGELOG.md index 41926e74cd3e..7c0d9d8b72ad 100644 --- a/sdk/search/arm-search/CHANGELOG.md +++ b/sdk/search/arm-search/CHANGELOG.md @@ -1,5 +1,58 @@ # Release History +## 3.3.0-beta.1 (2024-03-12) + +**Features** + + - Added operation group NetworkSecurityPerimeterConfigurations + - Added Interface NetworkSecurityPerimeterConfiguration + - Added Interface NetworkSecurityPerimeterConfigurationListResult + - Added Interface NetworkSecurityPerimeterConfigurationsGetOptionalParams + - Added Interface NetworkSecurityPerimeterConfigurationsListByServiceNextOptionalParams + - Added Interface NetworkSecurityPerimeterConfigurationsListByServiceOptionalParams + - Added Interface NetworkSecurityPerimeterConfigurationsReconcileHeaders + - Added Interface NetworkSecurityPerimeterConfigurationsReconcileOptionalParams + - Added Interface NSPConfigAccessRule + - Added Interface NSPConfigAccessRuleProperties + - Added Interface NSPConfigAssociation + - Added Interface NSPConfigNetworkSecurityPerimeterRule + - Added Interface NSPConfigPerimeter + - Added Interface NSPConfigProfile + - Added Interface NSPProvisioningIssue + - Added Interface NSPProvisioningIssueProperties + - Added Interface OperationAvailability + - Added Interface OperationLogsSpecification + - Added Interface OperationMetricDimension + - Added Interface OperationMetricsSpecification + - Added Interface OperationProperties + - Added Interface OperationServiceSpecification + - Added Interface ProxyResource + - Added Interface UserAssignedManagedIdentity + - Added Type Alias NetworkSecurityPerimeterConfigurationsGetResponse + - Added Type Alias NetworkSecurityPerimeterConfigurationsListByServiceNextResponse + - Added Type Alias NetworkSecurityPerimeterConfigurationsListByServiceResponse + - Added Type Alias NetworkSecurityPerimeterConfigurationsReconcileResponse + - Added Type Alias SearchBypass + - Added Type Alias SearchDisabledDataExfiltrationOption + - Interface CloudError has a new optional parameter message + - Interface Identity has a new optional parameter userAssignedIdentities + - Interface NetworkRuleSet has a new optional parameter bypass + - Interface Operation has a new optional parameter isDataAction + - Interface Operation has a new optional parameter origin + - Interface Operation has a new optional parameter properties + - Interface SearchService has a new optional parameter disabledDataExfiltrationOptions + - Interface SearchService has a new optional parameter eTag + - Interface SearchServiceUpdate has a new optional parameter disabledDataExfiltrationOptions + - Interface SearchServiceUpdate has a new optional parameter eTag + - Added Enum KnownIdentityType + - Added Enum KnownPublicNetworkAccess + - Added Enum KnownSearchBypass + - Added Enum KnownSearchDisabledDataExfiltrationOption + - Added Enum KnownSharedPrivateLinkResourceProvisioningState + - Added Enum KnownSharedPrivateLinkResourceStatus + - Added Enum KnownSkuName + + ## 3.2.0 (2023-10-09) **Features** diff --git a/sdk/search/arm-search/LICENSE b/sdk/search/arm-search/LICENSE index 3a1d9b6f24f7..7d5934740965 100644 --- a/sdk/search/arm-search/LICENSE +++ b/sdk/search/arm-search/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2023 Microsoft +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 diff --git a/sdk/search/arm-search/README.md b/sdk/search/arm-search/README.md index 34902b6166a2..1b4e86b147a2 100644 --- a/sdk/search/arm-search/README.md +++ b/sdk/search/arm-search/README.md @@ -6,7 +6,7 @@ Client that can be used to manage Azure AI Search services and API keys. [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/search/arm-search) | [Package (NPM)](https://www.npmjs.com/package/@azure/arm-search) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-search) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-search?view=azure-node-preview) | [Samples](https://github.com/Azure-Samples/azure-samples-js-management) ## Getting started diff --git a/sdk/search/arm-search/_meta.json b/sdk/search/arm-search/_meta.json index 3cb9a904799c..8704ffcb5b3e 100644 --- a/sdk/search/arm-search/_meta.json +++ b/sdk/search/arm-search/_meta.json @@ -1,8 +1,8 @@ { - "commit": "663ea6835c33bca216b63f777227db6a459a06b3", + "commit": "3004d02873a4b583ba6a3966a370f1ba19b5da1d", "readme": "specification/search/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\\search\\resource-manager\\readme.md --use=@autorest/typescript@6.0.9 --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=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\search\\resource-manager\\readme.md --use=@autorest/typescript@6.0.17 --generate-sample=true", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.7.2", - "use": "@autorest/typescript@6.0.9" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.4", + "use": "@autorest/typescript@6.0.17" } \ No newline at end of file diff --git a/sdk/search/arm-search/assets.json b/sdk/search/arm-search/assets.json index 3eea717ff72e..330c0ed2c3e8 100644 --- a/sdk/search/arm-search/assets.json +++ b/sdk/search/arm-search/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "js", "TagPrefix": "js/search/arm-search", - "Tag": "js/search/arm-search_58040c667d" + "Tag": "js/search/arm-search_19f57c5c47" } diff --git a/sdk/search/arm-search/package.json b/sdk/search/arm-search/package.json index 6abbc6f5364f..88672b8f0335 100644 --- a/sdk/search/arm-search/package.json +++ b/sdk/search/arm-search/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for SearchManagementClient.", - "version": "3.2.0", + "version": "3.3.0-beta.1", "engines": { "node": ">=18.0.0" }, @@ -12,8 +12,8 @@ "@azure/abort-controller": "^1.0.0", "@azure/core-paging": "^1.2.0", "@azure/core-client": "^1.7.0", - "@azure/core-auth": "^1.3.0", - "@azure/core-rest-pipeline": "^1.12.0", + "@azure/core-auth": "^1.6.0", + "@azure/core-rest-pipeline": "^1.14.0", "tslib": "^2.2.0" }, "keywords": [ @@ -29,22 +29,23 @@ "types": "./types/arm-search.d.ts", "devDependencies": { "@microsoft/api-extractor": "^7.31.1", - "mkdirp": "^1.0.4", + "mkdirp": "^2.1.2", "typescript": "~5.3.3", "uglify-js": "^3.4.9", "rimraf": "^5.0.0", "dotenv": "^16.0.0", + "@azure/dev-tool": "^1.0.0", "@azure/identity": "^4.0.1", "@azure-tools/test-recorder": "^3.0.0", "@azure-tools/test-credential": "^1.0.0", "mocha": "^10.0.0", + "@types/mocha": "^10.0.0", + "esm": "^3.2.18", "@types/chai": "^4.2.8", "chai": "^4.2.0", "cross-env": "^7.0.2", "@types/node": "^18.0.0", - "@azure/dev-tool": "^1.0.0", - "ts-node": "^10.0.0", - "@types/mocha": "^10.0.0" + "ts-node": "^10.0.0" }, "repository": { "type": "git", @@ -77,7 +78,6 @@ "pack": "npm pack 2>&1", "extract-api": "api-extractor run --local", "lint": "echo skipped", - "audit": "echo skipped", "clean": "rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", "build:node": "echo skipped", "build:browser": "echo skipped", @@ -115,4 +115,4 @@ "disableDocsMs": true, "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-search?view=azure-node-preview" } -} +} \ No newline at end of file diff --git a/sdk/search/arm-search/review/arm-search.api.md b/sdk/search/arm-search/review/arm-search.api.md index f1917eedf83a..1b63508b013d 100644 --- a/sdk/search/arm-search/review/arm-search.api.md +++ b/sdk/search/arm-search/review/arm-search.api.md @@ -65,6 +65,7 @@ export interface CheckNameAvailabilityOutput { // @public export interface CloudError { error?: CloudErrorBody; + message?: string; } // @public @@ -103,16 +104,27 @@ export interface Identity { readonly principalId?: string; readonly tenantId?: string; type: IdentityType; + userAssignedIdentities?: { + [propertyName: string]: UserAssignedManagedIdentity; + }; } // @public -export type IdentityType = "None" | "SystemAssigned"; +export type IdentityType = string; // @public export interface IpRule { value?: string; } +// @public +export enum KnownIdentityType { + None = "None", + SystemAssigned = "SystemAssigned", + SystemAssignedUserAssigned = "SystemAssigned, UserAssigned", + UserAssigned = "UserAssigned" +} + // @public export enum KnownPrivateLinkServiceConnectionProvisioningState { Canceled = "Canceled", @@ -123,6 +135,23 @@ export enum KnownPrivateLinkServiceConnectionProvisioningState { Updating = "Updating" } +// @public +export enum KnownPublicNetworkAccess { + Disabled = "disabled", + Enabled = "enabled" +} + +// @public +export enum KnownSearchBypass { + AzurePortal = "AzurePortal", + None = "None" +} + +// @public +export enum KnownSearchDisabledDataExfiltrationOption { + All = "All" +} + // @public export enum KnownSearchSemanticSearch { Disabled = "disabled", @@ -137,6 +166,34 @@ export enum KnownSharedPrivateLinkResourceAsyncOperationResult { Succeeded = "Succeeded" } +// @public +export enum KnownSharedPrivateLinkResourceProvisioningState { + Deleting = "Deleting", + Failed = "Failed", + Incomplete = "Incomplete", + Succeeded = "Succeeded", + Updating = "Updating" +} + +// @public +export enum KnownSharedPrivateLinkResourceStatus { + Approved = "Approved", + Disconnected = "Disconnected", + Pending = "Pending", + Rejected = "Rejected" +} + +// @public +export enum KnownSkuName { + Basic = "basic", + Free = "free", + Standard = "standard", + Standard2 = "standard2", + Standard3 = "standard3", + StorageOptimizedL1 = "storage_optimized_l1", + StorageOptimizedL2 = "storage_optimized_l2" +} + // @public export enum KnownUnavailableNameReason { AlreadyExists = "AlreadyExists", @@ -151,13 +208,163 @@ export interface ListQueryKeysResult { // @public export interface NetworkRuleSet { + bypass?: SearchBypass; ipRules?: IpRule[]; } +// @public +export interface NetworkSecurityPerimeterConfiguration extends ProxyResource { + networkSecurityPerimeter?: NSPConfigPerimeter; + profile?: NSPConfigProfile; + // (undocumented) + provisioningIssues?: NSPProvisioningIssue[]; + readonly provisioningState?: string; + resourceAssociation?: NSPConfigAssociation; +} + +// @public +export interface NetworkSecurityPerimeterConfigurationListResult { + readonly nextLink?: string; + readonly value?: NetworkSecurityPerimeterConfiguration[]; +} + +// @public +export interface NetworkSecurityPerimeterConfigurations { + beginReconcile(resourceGroupName: string, searchServiceName: string, nspConfigName: string, options?: NetworkSecurityPerimeterConfigurationsReconcileOptionalParams): Promise, NetworkSecurityPerimeterConfigurationsReconcileResponse>>; + beginReconcileAndWait(resourceGroupName: string, searchServiceName: string, nspConfigName: string, options?: NetworkSecurityPerimeterConfigurationsReconcileOptionalParams): Promise; + get(resourceGroupName: string, searchServiceName: string, nspConfigName: string, options?: NetworkSecurityPerimeterConfigurationsGetOptionalParams): Promise; + listByService(resourceGroupName: string, searchServiceName: string, options?: NetworkSecurityPerimeterConfigurationsListByServiceOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface NetworkSecurityPerimeterConfigurationsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type NetworkSecurityPerimeterConfigurationsGetResponse = NetworkSecurityPerimeterConfiguration; + +// @public +export interface NetworkSecurityPerimeterConfigurationsListByServiceNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type NetworkSecurityPerimeterConfigurationsListByServiceNextResponse = NetworkSecurityPerimeterConfigurationListResult; + +// @public +export interface NetworkSecurityPerimeterConfigurationsListByServiceOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type NetworkSecurityPerimeterConfigurationsListByServiceResponse = NetworkSecurityPerimeterConfigurationListResult; + +// @public +export interface NetworkSecurityPerimeterConfigurationsReconcileHeaders { + // (undocumented) + location?: string; +} + +// @public +export interface NetworkSecurityPerimeterConfigurationsReconcileOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type NetworkSecurityPerimeterConfigurationsReconcileResponse = NetworkSecurityPerimeterConfigurationsReconcileHeaders; + +// @public +export interface NSPConfigAccessRule { + // (undocumented) + name?: string; + properties?: NSPConfigAccessRuleProperties; +} + +// @public +export interface NSPConfigAccessRuleProperties { + // (undocumented) + addressPrefixes?: string[]; + // (undocumented) + direction?: string; + // (undocumented) + fullyQualifiedDomainNames?: string[]; + // (undocumented) + networkSecurityPerimeters?: NSPConfigNetworkSecurityPerimeterRule[]; + // (undocumented) + subscriptions?: string[]; +} + +// @public +export interface NSPConfigAssociation { + // (undocumented) + accessMode?: string; + // (undocumented) + name?: string; +} + +// @public +export interface NSPConfigNetworkSecurityPerimeterRule { + // (undocumented) + id?: string; + // (undocumented) + location?: string; + // (undocumented) + perimeterGuid?: string; +} + +// @public +export interface NSPConfigPerimeter { + // (undocumented) + id?: string; + // (undocumented) + location?: string; + // (undocumented) + perimeterGuid?: string; +} + +// @public +export interface NSPConfigProfile { + // (undocumented) + accessRules?: NSPConfigAccessRule[]; + // (undocumented) + accessRulesVersion?: string; + // (undocumented) + name?: string; +} + +// @public +export interface NSPProvisioningIssue { + // (undocumented) + name?: string; + properties?: NSPProvisioningIssueProperties; +} + +// @public +export interface NSPProvisioningIssueProperties { + // (undocumented) + description?: string; + // (undocumented) + issueType?: string; + // (undocumented) + severity?: string; + // (undocumented) + suggestedAccessRules?: string[]; + // (undocumented) + suggestedResourceIds?: string[]; +} + // @public export interface Operation { readonly display?: OperationDisplay; + readonly isDataAction?: boolean; readonly name?: string; + readonly origin?: string; + readonly properties?: OperationProperties; +} + +// @public +export interface OperationAvailability { + readonly blobDuration?: string; + readonly timeGrain?: string; } // @public @@ -174,11 +381,46 @@ export interface OperationListResult { readonly value?: Operation[]; } +// @public +export interface OperationLogsSpecification { + readonly blobDuration?: string; + readonly displayName?: string; + readonly name?: string; +} + +// @public +export interface OperationMetricDimension { + readonly displayName?: string; + readonly name?: string; +} + +// @public +export interface OperationMetricsSpecification { + readonly aggregationType?: string; + readonly availabilities?: OperationAvailability[]; + readonly dimensions?: OperationMetricDimension[]; + readonly displayDescription?: string; + readonly displayName?: string; + readonly name?: string; + readonly unit?: string; +} + +// @public +export interface OperationProperties { + readonly serviceSpecification?: OperationServiceSpecification; +} + // @public export interface Operations { list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; } +// @public +export interface OperationServiceSpecification { + readonly logSpecifications?: OperationLogsSpecification[]; + readonly metricSpecifications?: OperationMetricsSpecification[]; +} + // @public export interface OperationsListOptionalParams extends coreClient.OperationOptions { } @@ -306,7 +548,11 @@ export type PrivateLinkServiceConnectionStatus = "Pending" | "Approved" | "Rejec export type ProvisioningState = "succeeded" | "provisioning" | "failed"; // @public -export type PublicNetworkAccess = "enabled" | "disabled"; +export interface ProxyResource extends Resource { +} + +// @public +export type PublicNetworkAccess = string; // @public export interface QueryKey { @@ -378,6 +624,12 @@ export interface Resource { readonly type?: string; } +// @public +export type SearchBypass = string; + +// @public +export type SearchDisabledDataExfiltrationOption = string; + // @public export type SearchEncryptionComplianceStatus = "Compliant" | "NonCompliant"; @@ -394,6 +646,8 @@ export class SearchManagementClient extends coreClient.ServiceClient { // (undocumented) apiVersion: string; // (undocumented) + networkSecurityPerimeterConfigurations: NetworkSecurityPerimeterConfigurations; + // (undocumented) operations: Operations; // (undocumented) privateEndpointConnections: PrivateEndpointConnections; @@ -430,8 +684,10 @@ export type SearchSemanticSearch = string; // @public export interface SearchService extends TrackedResource { authOptions?: DataPlaneAuthOptions; + disabledDataExfiltrationOptions?: SearchDisabledDataExfiltrationOption[]; disableLocalAuth?: boolean; encryptionWithCmk?: EncryptionWithCmk; + readonly eTag?: string; hostingMode?: HostingMode; identity?: Identity; networkRuleSet?: NetworkRuleSet; @@ -454,13 +710,15 @@ export interface SearchServiceListResult { } // @public -export type SearchServiceStatus = "running" | "provisioning" | "deleting" | "degraded" | "disabled" | "error"; +export type SearchServiceStatus = "running" | "provisioning" | "deleting" | "degraded" | "disabled" | "error" | "stopped"; // @public export interface SearchServiceUpdate extends Resource { authOptions?: DataPlaneAuthOptions; + disabledDataExfiltrationOptions?: SearchDisabledDataExfiltrationOption[]; disableLocalAuth?: boolean; encryptionWithCmk?: EncryptionWithCmk; + readonly eTag?: string; hostingMode?: HostingMode; identity?: Identity; location?: string; @@ -601,7 +859,7 @@ export interface SharedPrivateLinkResourceProperties { } // @public -export type SharedPrivateLinkResourceProvisioningState = "Updating" | "Deleting" | "Failed" | "Succeeded" | "Incomplete"; +export type SharedPrivateLinkResourceProvisioningState = string; // @public export interface SharedPrivateLinkResources { @@ -655,7 +913,7 @@ export interface SharedPrivateLinkResourcesListByServiceOptionalParams extends c export type SharedPrivateLinkResourcesListByServiceResponse = SharedPrivateLinkResourceListResult; // @public -export type SharedPrivateLinkResourceStatus = "Pending" | "Approved" | "Rejected" | "Disconnected"; +export type SharedPrivateLinkResourceStatus = string; // @public export interface Sku { @@ -663,7 +921,7 @@ export interface Sku { } // @public -export type SkuName = "free" | "basic" | "standard" | "standard2" | "standard3" | "storage_optimized_l1" | "storage_optimized_l2"; +export type SkuName = string; // @public export interface TrackedResource extends Resource { @@ -705,6 +963,12 @@ export interface UsagesListBySubscriptionOptionalParams extends coreClient.Opera // @public export type UsagesListBySubscriptionResponse = QuotaUsagesListResult; +// @public +export interface UserAssignedManagedIdentity { + readonly clientId?: string; + readonly principalId?: string; +} + // (No @packageDocumentation comment for this package) ``` diff --git a/sdk/search/arm-search/samples-dev/adminKeysGetSample.ts b/sdk/search/arm-search/samples-dev/adminKeysGetSample.ts index be40c1734259..81733aafebf8 100644 --- a/sdk/search/arm-search/samples-dev/adminKeysGetSample.ts +++ b/sdk/search/arm-search/samples-dev/adminKeysGetSample.ts @@ -15,10 +15,10 @@ import * as dotenv from "dotenv"; dotenv.config(); /** - * This sample demonstrates how to Gets the primary and secondary admin API keys for the specified Azure Cognitive Search service. + * This sample demonstrates how to Gets the primary and secondary admin API keys for the specified Azure AI Search service. * - * @summary Gets the primary and secondary admin API keys for the specified Azure Cognitive Search service. - * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/SearchGetAdminKeys.json + * @summary Gets the primary and secondary admin API keys for the specified Azure AI Search service. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchGetAdminKeys.json */ async function searchGetAdminKeys() { const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; @@ -28,7 +28,7 @@ async function searchGetAdminKeys() { const client = new SearchManagementClient(credential, subscriptionId); const result = await client.adminKeys.get( resourceGroupName, - searchServiceName + searchServiceName, ); console.log(result); } diff --git a/sdk/search/arm-search/samples-dev/adminKeysRegenerateSample.ts b/sdk/search/arm-search/samples-dev/adminKeysRegenerateSample.ts index 5a929f7d4a13..7bfdcce19d4f 100644 --- a/sdk/search/arm-search/samples-dev/adminKeysRegenerateSample.ts +++ b/sdk/search/arm-search/samples-dev/adminKeysRegenerateSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Regenerates either the primary or secondary admin API key. You can only regenerate one key at a time. * * @summary Regenerates either the primary or secondary admin API key. You can only regenerate one key at a time. - * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/SearchRegenerateAdminKey.json + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchRegenerateAdminKey.json */ async function searchRegenerateAdminKey() { const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; @@ -30,7 +30,7 @@ async function searchRegenerateAdminKey() { const result = await client.adminKeys.regenerate( resourceGroupName, searchServiceName, - keyKind + keyKind, ); console.log(result); } diff --git a/sdk/search/arm-search/samples-dev/networkSecurityPerimeterConfigurationsGetSample.ts b/sdk/search/arm-search/samples-dev/networkSecurityPerimeterConfigurationsGetSample.ts new file mode 100644 index 000000000000..3e90ba68cecc --- /dev/null +++ b/sdk/search/arm-search/samples-dev/networkSecurityPerimeterConfigurationsGetSample.ts @@ -0,0 +1,42 @@ +/* + * 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 { SearchManagementClient } from "@azure/arm-search"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets a network security perimeter configuration. + * + * @summary Gets a network security perimeter configuration. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/NetworkSecurityPerimeterConfigurationsGet.json + */ +async function getAnNspConfigByName() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const nspConfigName = "00000001-2222-3333-4444-111144444444.assoc1"; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.networkSecurityPerimeterConfigurations.get( + resourceGroupName, + searchServiceName, + nspConfigName, + ); + console.log(result); +} + +async function main() { + getAnNspConfigByName(); +} + +main().catch(console.error); diff --git a/sdk/search/arm-search/samples-dev/networkSecurityPerimeterConfigurationsListByServiceSample.ts b/sdk/search/arm-search/samples-dev/networkSecurityPerimeterConfigurationsListByServiceSample.ts new file mode 100644 index 000000000000..feeb6bbab14c --- /dev/null +++ b/sdk/search/arm-search/samples-dev/networkSecurityPerimeterConfigurationsListByServiceSample.ts @@ -0,0 +1,43 @@ +/* + * 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 { SearchManagementClient } from "@azure/arm-search"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets a list of network security perimeter configurations for a search service. + * + * @summary Gets a list of network security perimeter configurations for a search service. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/NetworkSecurityPerimeterConfigurationsListByService.json + */ +async function listNspConfigsBySearchService() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.networkSecurityPerimeterConfigurations.listByService( + resourceGroupName, + searchServiceName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listNspConfigsBySearchService(); +} + +main().catch(console.error); diff --git a/sdk/search/arm-search/samples-dev/networkSecurityPerimeterConfigurationsReconcileSample.ts b/sdk/search/arm-search/samples-dev/networkSecurityPerimeterConfigurationsReconcileSample.ts new file mode 100644 index 000000000000..647222db3231 --- /dev/null +++ b/sdk/search/arm-search/samples-dev/networkSecurityPerimeterConfigurationsReconcileSample.ts @@ -0,0 +1,43 @@ +/* + * 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 { SearchManagementClient } from "@azure/arm-search"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Reconcile network security perimeter configuration for the Azure AI Search resource provider. This triggers a manual resync with network security perimeter configurations by ensuring the search service carries the latest configuration. + * + * @summary Reconcile network security perimeter configuration for the Azure AI Search resource provider. This triggers a manual resync with network security perimeter configurations by ensuring the search service carries the latest configuration. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/NetworkSecurityPerimeterConfigurationsReconcile.json + */ +async function reconcileNspConfig() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const nspConfigName = "00000001-2222-3333-4444-111144444444.assoc1"; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = + await client.networkSecurityPerimeterConfigurations.beginReconcileAndWait( + resourceGroupName, + searchServiceName, + nspConfigName, + ); + console.log(result); +} + +async function main() { + reconcileNspConfig(); +} + +main().catch(console.error); diff --git a/sdk/search/arm-search/samples-dev/operationsListSample.ts b/sdk/search/arm-search/samples-dev/operationsListSample.ts index bbe167426caf..2e38e7a1f140 100644 --- a/sdk/search/arm-search/samples-dev/operationsListSample.ts +++ b/sdk/search/arm-search/samples-dev/operationsListSample.ts @@ -18,9 +18,9 @@ dotenv.config(); * This sample demonstrates how to Lists all of the available REST API operations of the Microsoft.Search provider. * * @summary Lists all of the available REST API operations of the Microsoft.Search provider. - * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/OperationsList.json + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchListOperations.json */ -async function operationsList() { +async function searchListOperations() { const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -34,7 +34,7 @@ async function operationsList() { } async function main() { - operationsList(); + searchListOperations(); } main().catch(console.error); diff --git a/sdk/search/arm-search/samples-dev/privateEndpointConnectionsDeleteSample.ts b/sdk/search/arm-search/samples-dev/privateEndpointConnectionsDeleteSample.ts index 0146a22337a7..6d492d97979d 100644 --- a/sdk/search/arm-search/samples-dev/privateEndpointConnectionsDeleteSample.ts +++ b/sdk/search/arm-search/samples-dev/privateEndpointConnectionsDeleteSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Disconnects the private endpoint connection and deletes it from the search service. * * @summary Disconnects the private endpoint connection and deletes it from the search service. - * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/DeletePrivateEndpointConnection.json + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/DeletePrivateEndpointConnection.json */ async function privateEndpointConnectionDelete() { const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; @@ -31,7 +31,7 @@ async function privateEndpointConnectionDelete() { const result = await client.privateEndpointConnections.delete( resourceGroupName, searchServiceName, - privateEndpointConnectionName + privateEndpointConnectionName, ); console.log(result); } diff --git a/sdk/search/arm-search/samples-dev/privateEndpointConnectionsGetSample.ts b/sdk/search/arm-search/samples-dev/privateEndpointConnectionsGetSample.ts index 66d7935ea188..58f44338e4f3 100644 --- a/sdk/search/arm-search/samples-dev/privateEndpointConnectionsGetSample.ts +++ b/sdk/search/arm-search/samples-dev/privateEndpointConnectionsGetSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Gets the details of the private endpoint connection to the search service in the given resource group. * * @summary Gets the details of the private endpoint connection to the search service in the given resource group. - * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/GetPrivateEndpointConnection.json + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/GetPrivateEndpointConnection.json */ async function privateEndpointConnectionGet() { const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; @@ -31,7 +31,7 @@ async function privateEndpointConnectionGet() { const result = await client.privateEndpointConnections.get( resourceGroupName, searchServiceName, - privateEndpointConnectionName + privateEndpointConnectionName, ); console.log(result); } diff --git a/sdk/search/arm-search/samples-dev/privateEndpointConnectionsListByServiceSample.ts b/sdk/search/arm-search/samples-dev/privateEndpointConnectionsListByServiceSample.ts index dd1f1eeee370..287f544b7b6d 100644 --- a/sdk/search/arm-search/samples-dev/privateEndpointConnectionsListByServiceSample.ts +++ b/sdk/search/arm-search/samples-dev/privateEndpointConnectionsListByServiceSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Gets a list of all private endpoint connections in the given service. * * @summary Gets a list of all private endpoint connections in the given service. - * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/ListPrivateEndpointConnectionsByService.json + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/ListPrivateEndpointConnectionsByService.json */ async function listPrivateEndpointConnectionsByService() { const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; @@ -29,7 +29,7 @@ async function listPrivateEndpointConnectionsByService() { const resArray = new Array(); for await (let item of client.privateEndpointConnections.listByService( resourceGroupName, - searchServiceName + searchServiceName, )) { resArray.push(item); } diff --git a/sdk/search/arm-search/samples-dev/privateEndpointConnectionsUpdateSample.ts b/sdk/search/arm-search/samples-dev/privateEndpointConnectionsUpdateSample.ts index 4c3edfb49169..de3b80a92213 100644 --- a/sdk/search/arm-search/samples-dev/privateEndpointConnectionsUpdateSample.ts +++ b/sdk/search/arm-search/samples-dev/privateEndpointConnectionsUpdateSample.ts @@ -10,7 +10,7 @@ // Licensed under the MIT License. import { PrivateEndpointConnection, - SearchManagementClient + SearchManagementClient, } from "@azure/arm-search"; import { DefaultAzureCredential } from "@azure/identity"; import * as dotenv from "dotenv"; @@ -18,10 +18,10 @@ import * as dotenv from "dotenv"; dotenv.config(); /** - * This sample demonstrates how to Updates a Private Endpoint connection to the search service in the given resource group. + * This sample demonstrates how to Updates a private endpoint connection to the search service in the given resource group. * - * @summary Updates a Private Endpoint connection to the search service in the given resource group. - * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/UpdatePrivateEndpointConnection.json + * @summary Updates a private endpoint connection to the search service in the given resource group. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/UpdatePrivateEndpointConnection.json */ async function privateEndpointConnectionUpdate() { const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; @@ -32,10 +32,10 @@ async function privateEndpointConnectionUpdate() { const privateEndpointConnection: PrivateEndpointConnection = { properties: { privateLinkServiceConnectionState: { - description: "Rejected for some reason", - status: "Rejected" - } - } + description: "Rejected for some reason.", + status: "Rejected", + }, + }, }; const credential = new DefaultAzureCredential(); const client = new SearchManagementClient(credential, subscriptionId); @@ -43,7 +43,7 @@ async function privateEndpointConnectionUpdate() { resourceGroupName, searchServiceName, privateEndpointConnectionName, - privateEndpointConnection + privateEndpointConnection, ); console.log(result); } diff --git a/sdk/search/arm-search/samples-dev/privateLinkResourcesListSupportedSample.ts b/sdk/search/arm-search/samples-dev/privateLinkResourcesListSupportedSample.ts index f91762bde24c..ede3faec04e3 100644 --- a/sdk/search/arm-search/samples-dev/privateLinkResourcesListSupportedSample.ts +++ b/sdk/search/arm-search/samples-dev/privateLinkResourcesListSupportedSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Gets a list of all supported private link resource types for the given service. * * @summary Gets a list of all supported private link resource types for the given service. - * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/ListSupportedPrivateLinkResources.json + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/ListSupportedPrivateLinkResources.json */ async function listSupportedPrivateLinkResources() { const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; @@ -29,7 +29,7 @@ async function listSupportedPrivateLinkResources() { const resArray = new Array(); for await (let item of client.privateLinkResources.listSupported( resourceGroupName, - searchServiceName + searchServiceName, )) { resArray.push(item); } diff --git a/sdk/search/arm-search/samples-dev/queryKeysCreateSample.ts b/sdk/search/arm-search/samples-dev/queryKeysCreateSample.ts index b1d595920d16..ceb045cfdcb7 100644 --- a/sdk/search/arm-search/samples-dev/queryKeysCreateSample.ts +++ b/sdk/search/arm-search/samples-dev/queryKeysCreateSample.ts @@ -18,19 +18,20 @@ dotenv.config(); * This sample demonstrates how to Generates a new query key for the specified search service. You can create up to 50 query keys per service. * * @summary Generates a new query key for the specified search service. You can create up to 50 query keys per service. - * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/SearchCreateQueryKey.json + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateQueryKey.json */ async function searchCreateQueryKey() { const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; const searchServiceName = "mysearchservice"; - const name = "Query key for browser-based clients"; + const name = + "An API key granting read-only access to the documents collection of an index."; const credential = new DefaultAzureCredential(); const client = new SearchManagementClient(credential, subscriptionId); const result = await client.queryKeys.create( resourceGroupName, searchServiceName, - name + name, ); console.log(result); } diff --git a/sdk/search/arm-search/samples-dev/queryKeysDeleteSample.ts b/sdk/search/arm-search/samples-dev/queryKeysDeleteSample.ts index ffec9ae6fd6d..1bb57af82d39 100644 --- a/sdk/search/arm-search/samples-dev/queryKeysDeleteSample.ts +++ b/sdk/search/arm-search/samples-dev/queryKeysDeleteSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Deletes the specified query key. Unlike admin keys, query keys are not regenerated. The process for regenerating a query key is to delete and then recreate it. * * @summary Deletes the specified query key. Unlike admin keys, query keys are not regenerated. The process for regenerating a query key is to delete and then recreate it. - * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/SearchDeleteQueryKey.json + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchDeleteQueryKey.json */ async function searchDeleteQueryKey() { const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; @@ -30,7 +30,7 @@ async function searchDeleteQueryKey() { const result = await client.queryKeys.delete( resourceGroupName, searchServiceName, - key + key, ); console.log(result); } diff --git a/sdk/search/arm-search/samples-dev/queryKeysListBySearchServiceSample.ts b/sdk/search/arm-search/samples-dev/queryKeysListBySearchServiceSample.ts index 9bf9b4cc1636..f5f9534d4918 100644 --- a/sdk/search/arm-search/samples-dev/queryKeysListBySearchServiceSample.ts +++ b/sdk/search/arm-search/samples-dev/queryKeysListBySearchServiceSample.ts @@ -15,10 +15,10 @@ import * as dotenv from "dotenv"; dotenv.config(); /** - * This sample demonstrates how to Returns the list of query API keys for the given Azure Cognitive Search service. + * This sample demonstrates how to Returns the list of query API keys for the given Azure AI Search service. * - * @summary Returns the list of query API keys for the given Azure Cognitive Search service. - * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/SearchListQueryKeysBySearchService.json + * @summary Returns the list of query API keys for the given Azure AI Search service. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchListQueryKeysBySearchService.json */ async function searchListQueryKeysBySearchService() { const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; @@ -29,7 +29,7 @@ async function searchListQueryKeysBySearchService() { const resArray = new Array(); for await (let item of client.queryKeys.listBySearchService( resourceGroupName, - searchServiceName + searchServiceName, )) { resArray.push(item); } diff --git a/sdk/search/arm-search/samples-dev/servicesCheckNameAvailabilitySample.ts b/sdk/search/arm-search/samples-dev/servicesCheckNameAvailabilitySample.ts index 2745681c1cfb..4323782dcc95 100644 --- a/sdk/search/arm-search/samples-dev/servicesCheckNameAvailabilitySample.ts +++ b/sdk/search/arm-search/samples-dev/servicesCheckNameAvailabilitySample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Checks whether or not the given search service name is available for use. Search service names must be globally unique since they are part of the service URI (https://.search.windows.net). * * @summary Checks whether or not the given search service name is available for use. Search service names must be globally unique since they are part of the service URI (https://.search.windows.net). - * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/SearchCheckNameAvailability.json + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCheckNameAvailability.json */ async function searchCheckNameAvailability() { const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/search/arm-search/samples-dev/servicesCreateOrUpdateSample.ts b/sdk/search/arm-search/samples-dev/servicesCreateOrUpdateSample.ts index aba772befac0..18e9c3ed5b16 100644 --- a/sdk/search/arm-search/samples-dev/servicesCreateOrUpdateSample.ts +++ b/sdk/search/arm-search/samples-dev/servicesCreateOrUpdateSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. * * @summary Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. - * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/SearchCreateOrUpdateService.json + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateService.json */ async function searchCreateOrUpdateService() { const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; @@ -30,14 +30,14 @@ async function searchCreateOrUpdateService() { partitionCount: 1, replicaCount: 3, sku: { name: "standard" }, - tags: { appName: "My e-commerce app" } + tags: { appName: "My e-commerce app" }, }; const credential = new DefaultAzureCredential(); const client = new SearchManagementClient(credential, subscriptionId); const result = await client.services.beginCreateOrUpdateAndWait( resourceGroupName, searchServiceName, - service + service, ); console.log(result); } @@ -46,7 +46,7 @@ async function searchCreateOrUpdateService() { * This sample demonstrates how to Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. * * @summary Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. - * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/SearchCreateOrUpdateServiceAuthOptions.json + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceAuthOptions.json */ async function searchCreateOrUpdateServiceAuthOptions() { const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; @@ -54,21 +54,21 @@ async function searchCreateOrUpdateServiceAuthOptions() { const searchServiceName = "mysearchservice"; const service: SearchService = { authOptions: { - aadOrApiKey: { aadAuthFailureMode: "http401WithBearerChallenge" } + aadOrApiKey: { aadAuthFailureMode: "http401WithBearerChallenge" }, }, hostingMode: "default", location: "westus", partitionCount: 1, replicaCount: 3, sku: { name: "standard" }, - tags: { appName: "My e-commerce app" } + tags: { appName: "My e-commerce app" }, }; const credential = new DefaultAzureCredential(); const client = new SearchManagementClient(credential, subscriptionId); const result = await client.services.beginCreateOrUpdateAndWait( resourceGroupName, searchServiceName, - service + service, ); console.log(result); } @@ -77,7 +77,7 @@ async function searchCreateOrUpdateServiceAuthOptions() { * This sample demonstrates how to Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. * * @summary Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. - * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/SearchCreateOrUpdateServiceDisableLocalAuth.json + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceDisableLocalAuth.json */ async function searchCreateOrUpdateServiceDisableLocalAuth() { const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; @@ -90,14 +90,14 @@ async function searchCreateOrUpdateServiceDisableLocalAuth() { partitionCount: 1, replicaCount: 3, sku: { name: "standard" }, - tags: { appName: "My e-commerce app" } + tags: { appName: "My e-commerce app" }, }; const credential = new DefaultAzureCredential(); const client = new SearchManagementClient(credential, subscriptionId); const result = await client.services.beginCreateOrUpdateAndWait( resourceGroupName, searchServiceName, - service + service, ); console.log(result); } @@ -106,7 +106,7 @@ async function searchCreateOrUpdateServiceDisableLocalAuth() { * This sample demonstrates how to Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. * * @summary Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. - * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/SearchCreateOrUpdateServiceToAllowAccessFromPrivateEndpoints.json + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceToAllowAccessFromPrivateEndpoints.json */ async function searchCreateOrUpdateServiceToAllowAccessFromPrivateEndpoints() { const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; @@ -119,14 +119,14 @@ async function searchCreateOrUpdateServiceToAllowAccessFromPrivateEndpoints() { publicNetworkAccess: "disabled", replicaCount: 3, sku: { name: "standard" }, - tags: { appName: "My e-commerce app" } + tags: { appName: "My e-commerce app" }, }; const credential = new DefaultAzureCredential(); const client = new SearchManagementClient(credential, subscriptionId); const result = await client.services.beginCreateOrUpdateAndWait( resourceGroupName, searchServiceName, - service + service, ); console.log(result); } @@ -135,7 +135,7 @@ async function searchCreateOrUpdateServiceToAllowAccessFromPrivateEndpoints() { * This sample demonstrates how to Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. * * @summary Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. - * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/SearchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPs.json + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPs.json */ async function searchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPs() { const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; @@ -145,19 +145,19 @@ async function searchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPs() { hostingMode: "default", location: "westus", networkRuleSet: { - ipRules: [{ value: "123.4.5.6" }, { value: "123.4.6.0/18" }] + ipRules: [{ value: "123.4.5.6" }, { value: "123.4.6.0/18" }], }, partitionCount: 1, replicaCount: 1, sku: { name: "standard" }, - tags: { appName: "My e-commerce app" } + tags: { appName: "My e-commerce app" }, }; const credential = new DefaultAzureCredential(); const client = new SearchManagementClient(credential, subscriptionId); const result = await client.services.beginCreateOrUpdateAndWait( resourceGroupName, searchServiceName, - service + service, ); console.log(result); } @@ -166,7 +166,39 @@ async function searchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPs() { * This sample demonstrates how to Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. * * @summary Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. - * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/SearchCreateOrUpdateServiceWithCmkEnforcement.json + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass.json + */ +async function searchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const service: SearchService = { + hostingMode: "default", + location: "westus", + networkRuleSet: { + bypass: "AzurePortal", + ipRules: [{ value: "123.4.5.6" }, { value: "123.4.6.0/18" }], + }, + partitionCount: 1, + replicaCount: 1, + sku: { name: "standard" }, + tags: { appName: "My e-commerce app" }, + }; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.services.beginCreateOrUpdateAndWait( + resourceGroupName, + searchServiceName, + service, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. + * + * @summary Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceWithCmkEnforcement.json */ async function searchCreateOrUpdateServiceWithCmkEnforcement() { const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; @@ -179,14 +211,14 @@ async function searchCreateOrUpdateServiceWithCmkEnforcement() { partitionCount: 1, replicaCount: 3, sku: { name: "standard" }, - tags: { appName: "My e-commerce app" } + tags: { appName: "My e-commerce app" }, }; const credential = new DefaultAzureCredential(); const client = new SearchManagementClient(credential, subscriptionId); const result = await client.services.beginCreateOrUpdateAndWait( resourceGroupName, searchServiceName, - service + service, ); console.log(result); } @@ -195,7 +227,36 @@ async function searchCreateOrUpdateServiceWithCmkEnforcement() { * This sample demonstrates how to Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. * * @summary Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. - * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/SearchCreateOrUpdateServiceWithIdentity.json + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceWithDataExfiltration.json + */ +async function searchCreateOrUpdateServiceWithDataExfiltration() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const service: SearchService = { + disabledDataExfiltrationOptions: ["All"], + hostingMode: "default", + location: "westus", + partitionCount: 1, + replicaCount: 3, + sku: { name: "standard" }, + tags: { appName: "My e-commerce app" }, + }; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.services.beginCreateOrUpdateAndWait( + resourceGroupName, + searchServiceName, + service, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. + * + * @summary Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceWithIdentity.json */ async function searchCreateOrUpdateServiceWithIdentity() { const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; @@ -203,19 +264,25 @@ async function searchCreateOrUpdateServiceWithIdentity() { const searchServiceName = "mysearchservice"; const service: SearchService = { hostingMode: "default", - identity: { type: "SystemAssigned" }, + identity: { + type: "SystemAssigned, UserAssigned", + userAssignedIdentities: { + "/subscriptions/00000000000000000000000000000000/resourcegroups/rg1/providers/MicrosoftManagedIdentity/userAssignedIdentities/userMi": + {}, + }, + }, location: "westus", partitionCount: 1, replicaCount: 3, sku: { name: "standard" }, - tags: { appName: "My e-commerce app" } + tags: { appName: "My e-commerce app" }, }; const credential = new DefaultAzureCredential(); const client = new SearchManagementClient(credential, subscriptionId); const result = await client.services.beginCreateOrUpdateAndWait( resourceGroupName, searchServiceName, - service + service, ); console.log(result); } @@ -224,7 +291,7 @@ async function searchCreateOrUpdateServiceWithIdentity() { * This sample demonstrates how to Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. * * @summary Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. - * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/SearchCreateOrUpdateWithSemanticSearch.json + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateWithSemanticSearch.json */ async function searchCreateOrUpdateWithSemanticSearch() { const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; @@ -237,14 +304,14 @@ async function searchCreateOrUpdateWithSemanticSearch() { replicaCount: 3, semanticSearch: "free", sku: { name: "standard" }, - tags: { appName: "My e-commerce app" } + tags: { appName: "My e-commerce app" }, }; const credential = new DefaultAzureCredential(); const client = new SearchManagementClient(credential, subscriptionId); const result = await client.services.beginCreateOrUpdateAndWait( resourceGroupName, searchServiceName, - service + service, ); console.log(result); } @@ -255,7 +322,9 @@ async function main() { searchCreateOrUpdateServiceDisableLocalAuth(); searchCreateOrUpdateServiceToAllowAccessFromPrivateEndpoints(); searchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPs(); + searchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass(); searchCreateOrUpdateServiceWithCmkEnforcement(); + searchCreateOrUpdateServiceWithDataExfiltration(); searchCreateOrUpdateServiceWithIdentity(); searchCreateOrUpdateWithSemanticSearch(); } diff --git a/sdk/search/arm-search/samples-dev/servicesDeleteSample.ts b/sdk/search/arm-search/samples-dev/servicesDeleteSample.ts index ea91fc7cea30..934ea94708ed 100644 --- a/sdk/search/arm-search/samples-dev/servicesDeleteSample.ts +++ b/sdk/search/arm-search/samples-dev/servicesDeleteSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Deletes a search service in the given resource group, along with its associated resources. * * @summary Deletes a search service in the given resource group, along with its associated resources. - * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/SearchDeleteService.json + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchDeleteService.json */ async function searchDeleteService() { const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; @@ -28,7 +28,7 @@ async function searchDeleteService() { const client = new SearchManagementClient(credential, subscriptionId); const result = await client.services.delete( resourceGroupName, - searchServiceName + searchServiceName, ); console.log(result); } diff --git a/sdk/search/arm-search/samples-dev/servicesGetSample.ts b/sdk/search/arm-search/samples-dev/servicesGetSample.ts index ea520af4efc8..a6b102d2f393 100644 --- a/sdk/search/arm-search/samples-dev/servicesGetSample.ts +++ b/sdk/search/arm-search/samples-dev/servicesGetSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Gets the search service with the given name in the given resource group. * * @summary Gets the search service with the given name in the given resource group. - * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/SearchGetService.json + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchGetService.json */ async function searchGetService() { const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; @@ -28,7 +28,7 @@ async function searchGetService() { const client = new SearchManagementClient(credential, subscriptionId); const result = await client.services.get( resourceGroupName, - searchServiceName + searchServiceName, ); console.log(result); } diff --git a/sdk/search/arm-search/samples-dev/servicesListByResourceGroupSample.ts b/sdk/search/arm-search/samples-dev/servicesListByResourceGroupSample.ts index efd6b2613b0b..d2d98157ef85 100644 --- a/sdk/search/arm-search/samples-dev/servicesListByResourceGroupSample.ts +++ b/sdk/search/arm-search/samples-dev/servicesListByResourceGroupSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Gets a list of all Search services in the given resource group. * * @summary Gets a list of all Search services in the given resource group. - * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/SearchListServicesByResourceGroup.json + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchListServicesByResourceGroup.json */ async function searchListServicesByResourceGroup() { const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; @@ -27,7 +27,7 @@ async function searchListServicesByResourceGroup() { const client = new SearchManagementClient(credential, subscriptionId); const resArray = new Array(); for await (let item of client.services.listByResourceGroup( - resourceGroupName + resourceGroupName, )) { resArray.push(item); } diff --git a/sdk/search/arm-search/samples-dev/servicesListBySubscriptionSample.ts b/sdk/search/arm-search/samples-dev/servicesListBySubscriptionSample.ts index f6a638abbb30..c20d277bd4e3 100644 --- a/sdk/search/arm-search/samples-dev/servicesListBySubscriptionSample.ts +++ b/sdk/search/arm-search/samples-dev/servicesListBySubscriptionSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Gets a list of all Search services in the given subscription. * * @summary Gets a list of all Search services in the given subscription. - * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/SearchListServicesBySubscription.json + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchListServicesBySubscription.json */ async function searchListServicesBySubscription() { const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/search/arm-search/samples-dev/servicesUpdateSample.ts b/sdk/search/arm-search/samples-dev/servicesUpdateSample.ts index 9a83e4b2b138..04949fc7d969 100644 --- a/sdk/search/arm-search/samples-dev/servicesUpdateSample.ts +++ b/sdk/search/arm-search/samples-dev/servicesUpdateSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Updates an existing search service in the given resource group. * * @summary Updates an existing search service in the given resource group. - * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/SearchUpdateService.json + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateService.json */ async function searchUpdateService() { const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; @@ -26,14 +26,14 @@ async function searchUpdateService() { const searchServiceName = "mysearchservice"; const service: SearchServiceUpdate = { replicaCount: 2, - tags: { appName: "My e-commerce app", newTag: "Adding a new tag" } + tags: { appName: "My e-commerce app", newTag: "Adding a new tag" }, }; const credential = new DefaultAzureCredential(); const client = new SearchManagementClient(credential, subscriptionId); const result = await client.services.update( resourceGroupName, searchServiceName, - service + service, ); console.log(result); } @@ -42,7 +42,7 @@ async function searchUpdateService() { * This sample demonstrates how to Updates an existing search service in the given resource group. * * @summary Updates an existing search service in the given resource group. - * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/SearchUpdateServiceAuthOptions.json + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceAuthOptions.json */ async function searchUpdateServiceAuthOptions() { const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; @@ -50,17 +50,17 @@ async function searchUpdateServiceAuthOptions() { const searchServiceName = "mysearchservice"; const service: SearchServiceUpdate = { authOptions: { - aadOrApiKey: { aadAuthFailureMode: "http401WithBearerChallenge" } + aadOrApiKey: { aadAuthFailureMode: "http401WithBearerChallenge" }, }, replicaCount: 2, - tags: { appName: "My e-commerce app", newTag: "Adding a new tag" } + tags: { appName: "My e-commerce app", newTag: "Adding a new tag" }, }; const credential = new DefaultAzureCredential(); const client = new SearchManagementClient(credential, subscriptionId); const result = await client.services.update( resourceGroupName, searchServiceName, - service + service, ); console.log(result); } @@ -69,7 +69,7 @@ async function searchUpdateServiceAuthOptions() { * This sample demonstrates how to Updates an existing search service in the given resource group. * * @summary Updates an existing search service in the given resource group. - * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/SearchUpdateServiceDisableLocalAuth.json + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceDisableLocalAuth.json */ async function searchUpdateServiceDisableLocalAuth() { const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; @@ -78,14 +78,14 @@ async function searchUpdateServiceDisableLocalAuth() { const service: SearchServiceUpdate = { disableLocalAuth: true, replicaCount: 2, - tags: { appName: "My e-commerce app", newTag: "Adding a new tag" } + tags: { appName: "My e-commerce app", newTag: "Adding a new tag" }, }; const credential = new DefaultAzureCredential(); const client = new SearchManagementClient(credential, subscriptionId); const result = await client.services.update( resourceGroupName, searchServiceName, - service + service, ); console.log(result); } @@ -94,7 +94,7 @@ async function searchUpdateServiceDisableLocalAuth() { * This sample demonstrates how to Updates an existing search service in the given resource group. * * @summary Updates an existing search service in the given resource group. - * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/SearchUpdateServiceToAllowAccessFromPrivateEndpoints.json + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceToAllowAccessFromPrivateEndpoints.json */ async function searchUpdateServiceToAllowAccessFromPrivateEndpoints() { const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; @@ -103,14 +103,14 @@ async function searchUpdateServiceToAllowAccessFromPrivateEndpoints() { const service: SearchServiceUpdate = { partitionCount: 1, publicNetworkAccess: "disabled", - replicaCount: 1 + replicaCount: 1, }; const credential = new DefaultAzureCredential(); const client = new SearchManagementClient(credential, subscriptionId); const result = await client.services.update( resourceGroupName, searchServiceName, - service + service, ); console.log(result); } @@ -119,7 +119,7 @@ async function searchUpdateServiceToAllowAccessFromPrivateEndpoints() { * This sample demonstrates how to Updates an existing search service in the given resource group. * * @summary Updates an existing search service in the given resource group. - * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/SearchUpdateServiceToAllowAccessFromPublicCustomIPs.json + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceToAllowAccessFromPublicCustomIPs.json */ async function searchUpdateServiceToAllowAccessFromPublicCustomIPs() { const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; @@ -127,18 +127,18 @@ async function searchUpdateServiceToAllowAccessFromPublicCustomIPs() { const searchServiceName = "mysearchservice"; const service: SearchServiceUpdate = { networkRuleSet: { - ipRules: [{ value: "123.4.5.6" }, { value: "123.4.6.0/18" }] + ipRules: [{ value: "123.4.5.6" }, { value: "123.4.6.0/18" }], }, partitionCount: 1, publicNetworkAccess: "enabled", - replicaCount: 3 + replicaCount: 3, }; const credential = new DefaultAzureCredential(); const client = new SearchManagementClient(credential, subscriptionId); const result = await client.services.update( resourceGroupName, searchServiceName, - service + service, ); console.log(result); } @@ -147,7 +147,36 @@ async function searchUpdateServiceToAllowAccessFromPublicCustomIPs() { * This sample demonstrates how to Updates an existing search service in the given resource group. * * @summary Updates an existing search service in the given resource group. - * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/SearchUpdateServiceToRemoveIdentity.json + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass.json + */ +async function searchUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const service: SearchServiceUpdate = { + networkRuleSet: { + bypass: "AzurePortal", + ipRules: [{ value: "123.4.5.6" }, { value: "123.4.6.0/18" }], + }, + partitionCount: 1, + publicNetworkAccess: "enabled", + replicaCount: 3, + }; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.services.update( + resourceGroupName, + searchServiceName, + service, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Updates an existing search service in the given resource group. + * + * @summary Updates an existing search service in the given resource group. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceToRemoveIdentity.json */ async function searchUpdateServiceToRemoveIdentity() { const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; @@ -155,14 +184,14 @@ async function searchUpdateServiceToRemoveIdentity() { const searchServiceName = "mysearchservice"; const service: SearchServiceUpdate = { identity: { type: "None" }, - sku: { name: "standard" } + sku: { name: "standard" }, }; const credential = new DefaultAzureCredential(); const client = new SearchManagementClient(credential, subscriptionId); const result = await client.services.update( resourceGroupName, searchServiceName, - service + service, ); console.log(result); } @@ -171,7 +200,7 @@ async function searchUpdateServiceToRemoveIdentity() { * This sample demonstrates how to Updates an existing search service in the given resource group. * * @summary Updates an existing search service in the given resource group. - * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/SearchUpdateServiceWithCmkEnforcement.json + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceWithCmkEnforcement.json */ async function searchUpdateServiceWithCmkEnforcement() { const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; @@ -180,14 +209,39 @@ async function searchUpdateServiceWithCmkEnforcement() { const service: SearchServiceUpdate = { encryptionWithCmk: { enforcement: "Enabled" }, replicaCount: 2, - tags: { appName: "My e-commerce app", newTag: "Adding a new tag" } + tags: { appName: "My e-commerce app", newTag: "Adding a new tag" }, + }; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.services.update( + resourceGroupName, + searchServiceName, + service, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Updates an existing search service in the given resource group. + * + * @summary Updates an existing search service in the given resource group. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceWithDataExfiltration.json + */ +async function searchUpdateServiceWithDataExfiltration() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const service: SearchServiceUpdate = { + disabledDataExfiltrationOptions: ["All"], + replicaCount: 2, + tags: { appName: "My e-commerce app", newTag: "Adding a new tag" }, }; const credential = new DefaultAzureCredential(); const client = new SearchManagementClient(credential, subscriptionId); const result = await client.services.update( resourceGroupName, searchServiceName, - service + service, ); console.log(result); } @@ -196,7 +250,7 @@ async function searchUpdateServiceWithCmkEnforcement() { * This sample demonstrates how to Updates an existing search service in the given resource group. * * @summary Updates an existing search service in the given resource group. - * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/SearchUpdateServiceWithSemanticSearch.json + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceWithSemanticSearch.json */ async function searchUpdateServiceWithSemanticSearch() { const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; @@ -205,14 +259,14 @@ async function searchUpdateServiceWithSemanticSearch() { const service: SearchServiceUpdate = { replicaCount: 2, semanticSearch: "standard", - tags: { appName: "My e-commerce app", newTag: "Adding a new tag" } + tags: { appName: "My e-commerce app", newTag: "Adding a new tag" }, }; const credential = new DefaultAzureCredential(); const client = new SearchManagementClient(credential, subscriptionId); const result = await client.services.update( resourceGroupName, searchServiceName, - service + service, ); console.log(result); } @@ -223,8 +277,10 @@ async function main() { searchUpdateServiceDisableLocalAuth(); searchUpdateServiceToAllowAccessFromPrivateEndpoints(); searchUpdateServiceToAllowAccessFromPublicCustomIPs(); + searchUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass(); searchUpdateServiceToRemoveIdentity(); searchUpdateServiceWithCmkEnforcement(); + searchUpdateServiceWithDataExfiltration(); searchUpdateServiceWithSemanticSearch(); } diff --git a/sdk/search/arm-search/samples-dev/sharedPrivateLinkResourcesCreateOrUpdateSample.ts b/sdk/search/arm-search/samples-dev/sharedPrivateLinkResourcesCreateOrUpdateSample.ts index 222107676f69..df6788d5903b 100644 --- a/sdk/search/arm-search/samples-dev/sharedPrivateLinkResourcesCreateOrUpdateSample.ts +++ b/sdk/search/arm-search/samples-dev/sharedPrivateLinkResourcesCreateOrUpdateSample.ts @@ -10,7 +10,7 @@ // Licensed under the MIT License. import { SharedPrivateLinkResource, - SearchManagementClient + SearchManagementClient, } from "@azure/arm-search"; import { DefaultAzureCredential } from "@azure/identity"; import * as dotenv from "dotenv"; @@ -21,7 +21,7 @@ dotenv.config(); * This sample demonstrates how to Initiates the creation or update of a shared private link resource managed by the search service in the given resource group. * * @summary Initiates the creation or update of a shared private link resource managed by the search service in the given resource group. - * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/CreateOrUpdateSharedPrivateLinkResource.json + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/CreateOrUpdateSharedPrivateLinkResource.json */ async function sharedPrivateLinkResourceCreateOrUpdate() { const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; @@ -34,17 +34,18 @@ async function sharedPrivateLinkResourceCreateOrUpdate() { privateLinkResourceId: "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/storageAccountName", requestMessage: "please approve", - resourceRegion: undefined - } + resourceRegion: undefined, + }, }; const credential = new DefaultAzureCredential(); const client = new SearchManagementClient(credential, subscriptionId); - const result = await client.sharedPrivateLinkResources.beginCreateOrUpdateAndWait( - resourceGroupName, - searchServiceName, - sharedPrivateLinkResourceName, - sharedPrivateLinkResource - ); + const result = + await client.sharedPrivateLinkResources.beginCreateOrUpdateAndWait( + resourceGroupName, + searchServiceName, + sharedPrivateLinkResourceName, + sharedPrivateLinkResource, + ); console.log(result); } diff --git a/sdk/search/arm-search/samples-dev/sharedPrivateLinkResourcesDeleteSample.ts b/sdk/search/arm-search/samples-dev/sharedPrivateLinkResourcesDeleteSample.ts index 17766bbbf78f..20699b031063 100644 --- a/sdk/search/arm-search/samples-dev/sharedPrivateLinkResourcesDeleteSample.ts +++ b/sdk/search/arm-search/samples-dev/sharedPrivateLinkResourcesDeleteSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Initiates the deletion of the shared private link resource from the search service. * * @summary Initiates the deletion of the shared private link resource from the search service. - * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/DeleteSharedPrivateLinkResource.json + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/DeleteSharedPrivateLinkResource.json */ async function sharedPrivateLinkResourceDelete() { const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; @@ -30,7 +30,7 @@ async function sharedPrivateLinkResourceDelete() { const result = await client.sharedPrivateLinkResources.beginDeleteAndWait( resourceGroupName, searchServiceName, - sharedPrivateLinkResourceName + sharedPrivateLinkResourceName, ); console.log(result); } diff --git a/sdk/search/arm-search/samples-dev/sharedPrivateLinkResourcesGetSample.ts b/sdk/search/arm-search/samples-dev/sharedPrivateLinkResourcesGetSample.ts index bda8b185f21a..6f0aa6e28212 100644 --- a/sdk/search/arm-search/samples-dev/sharedPrivateLinkResourcesGetSample.ts +++ b/sdk/search/arm-search/samples-dev/sharedPrivateLinkResourcesGetSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Gets the details of the shared private link resource managed by the search service in the given resource group. * * @summary Gets the details of the shared private link resource managed by the search service in the given resource group. - * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/GetSharedPrivateLinkResource.json + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/GetSharedPrivateLinkResource.json */ async function sharedPrivateLinkResourceGet() { const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; @@ -30,7 +30,7 @@ async function sharedPrivateLinkResourceGet() { const result = await client.sharedPrivateLinkResources.get( resourceGroupName, searchServiceName, - sharedPrivateLinkResourceName + sharedPrivateLinkResourceName, ); console.log(result); } diff --git a/sdk/search/arm-search/samples-dev/sharedPrivateLinkResourcesListByServiceSample.ts b/sdk/search/arm-search/samples-dev/sharedPrivateLinkResourcesListByServiceSample.ts index 2a780830d4a0..2930e326088d 100644 --- a/sdk/search/arm-search/samples-dev/sharedPrivateLinkResourcesListByServiceSample.ts +++ b/sdk/search/arm-search/samples-dev/sharedPrivateLinkResourcesListByServiceSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Gets a list of all shared private link resources managed by the given service. * * @summary Gets a list of all shared private link resources managed by the given service. - * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/ListSharedPrivateLinkResourcesByService.json + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/ListSharedPrivateLinkResourcesByService.json */ async function listSharedPrivateLinkResourcesByService() { const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; @@ -29,7 +29,7 @@ async function listSharedPrivateLinkResourcesByService() { const resArray = new Array(); for await (let item of client.sharedPrivateLinkResources.listByService( resourceGroupName, - searchServiceName + searchServiceName, )) { resArray.push(item); } diff --git a/sdk/search/arm-search/samples-dev/usageBySubscriptionSkuSample.ts b/sdk/search/arm-search/samples-dev/usageBySubscriptionSkuSample.ts index d35b8c9a8abd..3f781a83a983 100644 --- a/sdk/search/arm-search/samples-dev/usageBySubscriptionSkuSample.ts +++ b/sdk/search/arm-search/samples-dev/usageBySubscriptionSkuSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Gets the quota usage for a search sku in the given subscription. * * @summary Gets the quota usage for a search sku in the given subscription. - * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/GetQuotaUsage.json + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/GetQuotaUsage.json */ async function getQuotaUsage() { const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/search/arm-search/samples-dev/usagesListBySubscriptionSample.ts b/sdk/search/arm-search/samples-dev/usagesListBySubscriptionSample.ts index d60fb477938e..f58911eefd8a 100644 --- a/sdk/search/arm-search/samples-dev/usagesListBySubscriptionSample.ts +++ b/sdk/search/arm-search/samples-dev/usagesListBySubscriptionSample.ts @@ -15,10 +15,10 @@ import * as dotenv from "dotenv"; dotenv.config(); /** - * This sample demonstrates how to Gets a list of all Search quota usages in the given subscription. + * This sample demonstrates how to Get a list of all Azure AI Search quota usages across the subscription. * - * @summary Gets a list of all Search quota usages in the given subscription. - * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/GetQuotaUsagesList.json + * @summary Get a list of all Azure AI Search quota usages across the subscription. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/GetQuotaUsagesList.json */ async function getQuotaUsagesList() { const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/search/arm-search/samples/v3-beta/javascript/README.md b/sdk/search/arm-search/samples/v3-beta/javascript/README.md new file mode 100644 index 000000000000..9b24f28acb6a --- /dev/null +++ b/sdk/search/arm-search/samples/v3-beta/javascript/README.md @@ -0,0 +1,102 @@ +# client library samples for JavaScript (Beta) + +These sample programs show how to use the JavaScript client libraries for in some common scenarios. + +| **File Name** | **Description** | +| ------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [adminKeysGetSample.js][adminkeysgetsample] | Gets the primary and secondary admin API keys for the specified Azure AI Search service. x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchGetAdminKeys.json | +| [adminKeysRegenerateSample.js][adminkeysregeneratesample] | Regenerates either the primary or secondary admin API key. You can only regenerate one key at a time. x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchRegenerateAdminKey.json | +| [networkSecurityPerimeterConfigurationsGetSample.js][networksecurityperimeterconfigurationsgetsample] | Gets a network security perimeter configuration. x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/NetworkSecurityPerimeterConfigurationsGet.json | +| [networkSecurityPerimeterConfigurationsListByServiceSample.js][networksecurityperimeterconfigurationslistbyservicesample] | Gets a list of network security perimeter configurations for a search service. x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/NetworkSecurityPerimeterConfigurationsListByService.json | +| [networkSecurityPerimeterConfigurationsReconcileSample.js][networksecurityperimeterconfigurationsreconcilesample] | Reconcile network security perimeter configuration for the Azure AI Search resource provider. This triggers a manual resync with network security perimeter configurations by ensuring the search service carries the latest configuration. x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/NetworkSecurityPerimeterConfigurationsReconcile.json | +| [operationsListSample.js][operationslistsample] | Lists all of the available REST API operations of the Microsoft.Search provider. x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchListOperations.json | +| [privateEndpointConnectionsDeleteSample.js][privateendpointconnectionsdeletesample] | Disconnects the private endpoint connection and deletes it from the search service. x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/DeletePrivateEndpointConnection.json | +| [privateEndpointConnectionsGetSample.js][privateendpointconnectionsgetsample] | Gets the details of the private endpoint connection to the search service in the given resource group. x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/GetPrivateEndpointConnection.json | +| [privateEndpointConnectionsListByServiceSample.js][privateendpointconnectionslistbyservicesample] | Gets a list of all private endpoint connections in the given service. x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/ListPrivateEndpointConnectionsByService.json | +| [privateEndpointConnectionsUpdateSample.js][privateendpointconnectionsupdatesample] | Updates a private endpoint connection to the search service in the given resource group. x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/UpdatePrivateEndpointConnection.json | +| [privateLinkResourcesListSupportedSample.js][privatelinkresourceslistsupportedsample] | Gets a list of all supported private link resource types for the given service. x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/ListSupportedPrivateLinkResources.json | +| [queryKeysCreateSample.js][querykeyscreatesample] | Generates a new query key for the specified search service. You can create up to 50 query keys per service. x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateQueryKey.json | +| [queryKeysDeleteSample.js][querykeysdeletesample] | Deletes the specified query key. Unlike admin keys, query keys are not regenerated. The process for regenerating a query key is to delete and then recreate it. x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchDeleteQueryKey.json | +| [queryKeysListBySearchServiceSample.js][querykeyslistbysearchservicesample] | Returns the list of query API keys for the given Azure AI Search service. x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchListQueryKeysBySearchService.json | +| [servicesCheckNameAvailabilitySample.js][serviceschecknameavailabilitysample] | Checks whether or not the given search service name is available for use. Search service names must be globally unique since they are part of the service URI (https://.search.windows.net). x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCheckNameAvailability.json | +| [servicesCreateOrUpdateSample.js][servicescreateorupdatesample] | Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateService.json | +| [servicesDeleteSample.js][servicesdeletesample] | Deletes a search service in the given resource group, along with its associated resources. x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchDeleteService.json | +| [servicesGetSample.js][servicesgetsample] | Gets the search service with the given name in the given resource group. x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchGetService.json | +| [servicesListByResourceGroupSample.js][serviceslistbyresourcegroupsample] | Gets a list of all Search services in the given resource group. x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchListServicesByResourceGroup.json | +| [servicesListBySubscriptionSample.js][serviceslistbysubscriptionsample] | Gets a list of all Search services in the given subscription. x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchListServicesBySubscription.json | +| [servicesUpdateSample.js][servicesupdatesample] | Updates an existing search service in the given resource group. x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateService.json | +| [sharedPrivateLinkResourcesCreateOrUpdateSample.js][sharedprivatelinkresourcescreateorupdatesample] | Initiates the creation or update of a shared private link resource managed by the search service in the given resource group. x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/CreateOrUpdateSharedPrivateLinkResource.json | +| [sharedPrivateLinkResourcesDeleteSample.js][sharedprivatelinkresourcesdeletesample] | Initiates the deletion of the shared private link resource from the search service. x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/DeleteSharedPrivateLinkResource.json | +| [sharedPrivateLinkResourcesGetSample.js][sharedprivatelinkresourcesgetsample] | Gets the details of the shared private link resource managed by the search service in the given resource group. x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/GetSharedPrivateLinkResource.json | +| [sharedPrivateLinkResourcesListByServiceSample.js][sharedprivatelinkresourceslistbyservicesample] | Gets a list of all shared private link resources managed by the given service. x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/ListSharedPrivateLinkResourcesByService.json | +| [usageBySubscriptionSkuSample.js][usagebysubscriptionskusample] | Gets the quota usage for a search sku in the given subscription. x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/GetQuotaUsage.json | +| [usagesListBySubscriptionSample.js][usageslistbysubscriptionsample] | Get a list of all Azure AI Search quota usages across the subscription. x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/GetQuotaUsagesList.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 adminKeysGetSample.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 cross-env SEARCH_SUBSCRIPTION_ID="" SEARCH_RESOURCE_GROUP="" node adminKeysGetSample.js +``` + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +[adminkeysgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/arm-search/samples/v3-beta/javascript/adminKeysGetSample.js +[adminkeysregeneratesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/arm-search/samples/v3-beta/javascript/adminKeysRegenerateSample.js +[networksecurityperimeterconfigurationsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/arm-search/samples/v3-beta/javascript/networkSecurityPerimeterConfigurationsGetSample.js +[networksecurityperimeterconfigurationslistbyservicesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/arm-search/samples/v3-beta/javascript/networkSecurityPerimeterConfigurationsListByServiceSample.js +[networksecurityperimeterconfigurationsreconcilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/arm-search/samples/v3-beta/javascript/networkSecurityPerimeterConfigurationsReconcileSample.js +[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/arm-search/samples/v3-beta/javascript/operationsListSample.js +[privateendpointconnectionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/arm-search/samples/v3-beta/javascript/privateEndpointConnectionsDeleteSample.js +[privateendpointconnectionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/arm-search/samples/v3-beta/javascript/privateEndpointConnectionsGetSample.js +[privateendpointconnectionslistbyservicesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/arm-search/samples/v3-beta/javascript/privateEndpointConnectionsListByServiceSample.js +[privateendpointconnectionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/arm-search/samples/v3-beta/javascript/privateEndpointConnectionsUpdateSample.js +[privatelinkresourceslistsupportedsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/arm-search/samples/v3-beta/javascript/privateLinkResourcesListSupportedSample.js +[querykeyscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/arm-search/samples/v3-beta/javascript/queryKeysCreateSample.js +[querykeysdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/arm-search/samples/v3-beta/javascript/queryKeysDeleteSample.js +[querykeyslistbysearchservicesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/arm-search/samples/v3-beta/javascript/queryKeysListBySearchServiceSample.js +[serviceschecknameavailabilitysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/arm-search/samples/v3-beta/javascript/servicesCheckNameAvailabilitySample.js +[servicescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/arm-search/samples/v3-beta/javascript/servicesCreateOrUpdateSample.js +[servicesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/arm-search/samples/v3-beta/javascript/servicesDeleteSample.js +[servicesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/arm-search/samples/v3-beta/javascript/servicesGetSample.js +[serviceslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/arm-search/samples/v3-beta/javascript/servicesListByResourceGroupSample.js +[serviceslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/arm-search/samples/v3-beta/javascript/servicesListBySubscriptionSample.js +[servicesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/arm-search/samples/v3-beta/javascript/servicesUpdateSample.js +[sharedprivatelinkresourcescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/arm-search/samples/v3-beta/javascript/sharedPrivateLinkResourcesCreateOrUpdateSample.js +[sharedprivatelinkresourcesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/arm-search/samples/v3-beta/javascript/sharedPrivateLinkResourcesDeleteSample.js +[sharedprivatelinkresourcesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/arm-search/samples/v3-beta/javascript/sharedPrivateLinkResourcesGetSample.js +[sharedprivatelinkresourceslistbyservicesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/arm-search/samples/v3-beta/javascript/sharedPrivateLinkResourcesListByServiceSample.js +[usagebysubscriptionskusample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/arm-search/samples/v3-beta/javascript/usageBySubscriptionSkuSample.js +[usageslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/arm-search/samples/v3-beta/javascript/usagesListBySubscriptionSample.js +[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-search?view=azure-node-preview +[freesub]: https://azure.microsoft.com/free/ +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/search/arm-search/README.md diff --git a/sdk/search/arm-search/samples/v3-beta/javascript/adminKeysGetSample.js b/sdk/search/arm-search/samples/v3-beta/javascript/adminKeysGetSample.js new file mode 100644 index 000000000000..01c2b855d737 --- /dev/null +++ b/sdk/search/arm-search/samples/v3-beta/javascript/adminKeysGetSample.js @@ -0,0 +1,35 @@ +/* + * 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. +const { SearchManagementClient } = require("@azure/arm-search"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Gets the primary and secondary admin API keys for the specified Azure AI Search service. + * + * @summary Gets the primary and secondary admin API keys for the specified Azure AI Search service. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchGetAdminKeys.json + */ +async function searchGetAdminKeys() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.adminKeys.get(resourceGroupName, searchServiceName); + console.log(result); +} + +async function main() { + searchGetAdminKeys(); +} + +main().catch(console.error); diff --git a/sdk/search/arm-search/samples/v3-beta/javascript/adminKeysRegenerateSample.js b/sdk/search/arm-search/samples/v3-beta/javascript/adminKeysRegenerateSample.js new file mode 100644 index 000000000000..2188a3c69757 --- /dev/null +++ b/sdk/search/arm-search/samples/v3-beta/javascript/adminKeysRegenerateSample.js @@ -0,0 +1,36 @@ +/* + * 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. +const { SearchManagementClient } = require("@azure/arm-search"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Regenerates either the primary or secondary admin API key. You can only regenerate one key at a time. + * + * @summary Regenerates either the primary or secondary admin API key. You can only regenerate one key at a time. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchRegenerateAdminKey.json + */ +async function searchRegenerateAdminKey() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const keyKind = "primary"; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.adminKeys.regenerate(resourceGroupName, searchServiceName, keyKind); + console.log(result); +} + +async function main() { + searchRegenerateAdminKey(); +} + +main().catch(console.error); diff --git a/sdk/search/arm-search/samples/v3-beta/javascript/networkSecurityPerimeterConfigurationsGetSample.js b/sdk/search/arm-search/samples/v3-beta/javascript/networkSecurityPerimeterConfigurationsGetSample.js new file mode 100644 index 000000000000..9f7e5141028f --- /dev/null +++ b/sdk/search/arm-search/samples/v3-beta/javascript/networkSecurityPerimeterConfigurationsGetSample.js @@ -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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SearchManagementClient } = require("@azure/arm-search"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Gets a network security perimeter configuration. + * + * @summary Gets a network security perimeter configuration. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/NetworkSecurityPerimeterConfigurationsGet.json + */ +async function getAnNspConfigByName() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const nspConfigName = "00000001-2222-3333-4444-111144444444.assoc1"; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.networkSecurityPerimeterConfigurations.get( + resourceGroupName, + searchServiceName, + nspConfigName, + ); + console.log(result); +} + +async function main() { + getAnNspConfigByName(); +} + +main().catch(console.error); diff --git a/sdk/search/arm-search/samples/v3-beta/javascript/networkSecurityPerimeterConfigurationsListByServiceSample.js b/sdk/search/arm-search/samples/v3-beta/javascript/networkSecurityPerimeterConfigurationsListByServiceSample.js new file mode 100644 index 000000000000..f59095f3b83f --- /dev/null +++ b/sdk/search/arm-search/samples/v3-beta/javascript/networkSecurityPerimeterConfigurationsListByServiceSample.js @@ -0,0 +1,41 @@ +/* + * 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. +const { SearchManagementClient } = require("@azure/arm-search"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Gets a list of network security perimeter configurations for a search service. + * + * @summary Gets a list of network security perimeter configurations for a search service. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/NetworkSecurityPerimeterConfigurationsListByService.json + */ +async function listNspConfigsBySearchService() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.networkSecurityPerimeterConfigurations.listByService( + resourceGroupName, + searchServiceName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listNspConfigsBySearchService(); +} + +main().catch(console.error); diff --git a/sdk/search/arm-search/samples/v3-beta/javascript/networkSecurityPerimeterConfigurationsReconcileSample.js b/sdk/search/arm-search/samples/v3-beta/javascript/networkSecurityPerimeterConfigurationsReconcileSample.js new file mode 100644 index 000000000000..8b31491f14f7 --- /dev/null +++ b/sdk/search/arm-search/samples/v3-beta/javascript/networkSecurityPerimeterConfigurationsReconcileSample.js @@ -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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SearchManagementClient } = require("@azure/arm-search"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Reconcile network security perimeter configuration for the Azure AI Search resource provider. This triggers a manual resync with network security perimeter configurations by ensuring the search service carries the latest configuration. + * + * @summary Reconcile network security perimeter configuration for the Azure AI Search resource provider. This triggers a manual resync with network security perimeter configurations by ensuring the search service carries the latest configuration. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/NetworkSecurityPerimeterConfigurationsReconcile.json + */ +async function reconcileNspConfig() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const nspConfigName = "00000001-2222-3333-4444-111144444444.assoc1"; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.networkSecurityPerimeterConfigurations.beginReconcileAndWait( + resourceGroupName, + searchServiceName, + nspConfigName, + ); + console.log(result); +} + +async function main() { + reconcileNspConfig(); +} + +main().catch(console.error); diff --git a/sdk/search/arm-search/samples/v3-beta/javascript/operationsListSample.js b/sdk/search/arm-search/samples/v3-beta/javascript/operationsListSample.js new file mode 100644 index 000000000000..231481dd3afd --- /dev/null +++ b/sdk/search/arm-search/samples/v3-beta/javascript/operationsListSample.js @@ -0,0 +1,37 @@ +/* + * 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. +const { SearchManagementClient } = require("@azure/arm-search"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Lists all of the available REST API operations of the Microsoft.Search provider. + * + * @summary Lists all of the available REST API operations of the Microsoft.Search provider. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchListOperations.json + */ +async function searchListOperations() { + const subscriptionId = + process.env["SEARCH_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.operations.list()) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + searchListOperations(); +} + +main().catch(console.error); diff --git a/sdk/search/arm-search/samples/v3-beta/javascript/package.json b/sdk/search/arm-search/samples/v3-beta/javascript/package.json new file mode 100644 index 000000000000..2ee5a56f34b7 --- /dev/null +++ b/sdk/search/arm-search/samples/v3-beta/javascript/package.json @@ -0,0 +1,32 @@ +{ + "name": "@azure-samples/arm-search-js-beta", + "private": true, + "version": "1.0.0", + "description": " 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/search/arm-search" + }, + "keywords": [ + "node", + "azure", + "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/search/arm-search", + "dependencies": { + "@azure/arm-search": "next", + "dotenv": "latest", + "@azure/identity": "^4.0.1" + } +} diff --git a/sdk/search/arm-search/samples/v3-beta/javascript/privateEndpointConnectionsDeleteSample.js b/sdk/search/arm-search/samples/v3-beta/javascript/privateEndpointConnectionsDeleteSample.js new file mode 100644 index 000000000000..e1e3043195c8 --- /dev/null +++ b/sdk/search/arm-search/samples/v3-beta/javascript/privateEndpointConnectionsDeleteSample.js @@ -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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SearchManagementClient } = require("@azure/arm-search"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Disconnects the private endpoint connection and deletes it from the search service. + * + * @summary Disconnects the private endpoint connection and deletes it from the search service. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/DeletePrivateEndpointConnection.json + */ +async function privateEndpointConnectionDelete() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const privateEndpointConnectionName = "testEndpoint.50bf4fbe-d7c1-4b48-a642-4f5892642546"; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.privateEndpointConnections.delete( + resourceGroupName, + searchServiceName, + privateEndpointConnectionName, + ); + console.log(result); +} + +async function main() { + privateEndpointConnectionDelete(); +} + +main().catch(console.error); diff --git a/sdk/search/arm-search/samples/v3-beta/javascript/privateEndpointConnectionsGetSample.js b/sdk/search/arm-search/samples/v3-beta/javascript/privateEndpointConnectionsGetSample.js new file mode 100644 index 000000000000..55263e1ea487 --- /dev/null +++ b/sdk/search/arm-search/samples/v3-beta/javascript/privateEndpointConnectionsGetSample.js @@ -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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SearchManagementClient } = require("@azure/arm-search"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Gets the details of the private endpoint connection to the search service in the given resource group. + * + * @summary Gets the details of the private endpoint connection to the search service in the given resource group. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/GetPrivateEndpointConnection.json + */ +async function privateEndpointConnectionGet() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const privateEndpointConnectionName = "testEndpoint.50bf4fbe-d7c1-4b48-a642-4f5892642546"; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.privateEndpointConnections.get( + resourceGroupName, + searchServiceName, + privateEndpointConnectionName, + ); + console.log(result); +} + +async function main() { + privateEndpointConnectionGet(); +} + +main().catch(console.error); diff --git a/sdk/search/arm-search/samples/v3-beta/javascript/privateEndpointConnectionsListByServiceSample.js b/sdk/search/arm-search/samples/v3-beta/javascript/privateEndpointConnectionsListByServiceSample.js new file mode 100644 index 000000000000..a6d286a9bf18 --- /dev/null +++ b/sdk/search/arm-search/samples/v3-beta/javascript/privateEndpointConnectionsListByServiceSample.js @@ -0,0 +1,41 @@ +/* + * 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. +const { SearchManagementClient } = require("@azure/arm-search"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Gets a list of all private endpoint connections in the given service. + * + * @summary Gets a list of all private endpoint connections in the given service. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/ListPrivateEndpointConnectionsByService.json + */ +async function listPrivateEndpointConnectionsByService() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.privateEndpointConnections.listByService( + resourceGroupName, + searchServiceName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listPrivateEndpointConnectionsByService(); +} + +main().catch(console.error); diff --git a/sdk/search/arm-search/samples/v3-beta/javascript/privateEndpointConnectionsUpdateSample.js b/sdk/search/arm-search/samples/v3-beta/javascript/privateEndpointConnectionsUpdateSample.js new file mode 100644 index 000000000000..637bd5cea08f --- /dev/null +++ b/sdk/search/arm-search/samples/v3-beta/javascript/privateEndpointConnectionsUpdateSample.js @@ -0,0 +1,49 @@ +/* + * 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. +const { SearchManagementClient } = require("@azure/arm-search"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Updates a private endpoint connection to the search service in the given resource group. + * + * @summary Updates a private endpoint connection to the search service in the given resource group. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/UpdatePrivateEndpointConnection.json + */ +async function privateEndpointConnectionUpdate() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const privateEndpointConnectionName = "testEndpoint.50bf4fbe-d7c1-4b48-a642-4f5892642546"; + const privateEndpointConnection = { + properties: { + privateLinkServiceConnectionState: { + description: "Rejected for some reason.", + status: "Rejected", + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.privateEndpointConnections.update( + resourceGroupName, + searchServiceName, + privateEndpointConnectionName, + privateEndpointConnection, + ); + console.log(result); +} + +async function main() { + privateEndpointConnectionUpdate(); +} + +main().catch(console.error); diff --git a/sdk/search/arm-search/samples/v3-beta/javascript/privateLinkResourcesListSupportedSample.js b/sdk/search/arm-search/samples/v3-beta/javascript/privateLinkResourcesListSupportedSample.js new file mode 100644 index 000000000000..b15f71c1ec26 --- /dev/null +++ b/sdk/search/arm-search/samples/v3-beta/javascript/privateLinkResourcesListSupportedSample.js @@ -0,0 +1,41 @@ +/* + * 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. +const { SearchManagementClient } = require("@azure/arm-search"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Gets a list of all supported private link resource types for the given service. + * + * @summary Gets a list of all supported private link resource types for the given service. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/ListSupportedPrivateLinkResources.json + */ +async function listSupportedPrivateLinkResources() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.privateLinkResources.listSupported( + resourceGroupName, + searchServiceName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listSupportedPrivateLinkResources(); +} + +main().catch(console.error); diff --git a/sdk/search/arm-search/samples/v3-beta/javascript/queryKeysCreateSample.js b/sdk/search/arm-search/samples/v3-beta/javascript/queryKeysCreateSample.js new file mode 100644 index 000000000000..0b8459c27207 --- /dev/null +++ b/sdk/search/arm-search/samples/v3-beta/javascript/queryKeysCreateSample.js @@ -0,0 +1,36 @@ +/* + * 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. +const { SearchManagementClient } = require("@azure/arm-search"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Generates a new query key for the specified search service. You can create up to 50 query keys per service. + * + * @summary Generates a new query key for the specified search service. You can create up to 50 query keys per service. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateQueryKey.json + */ +async function searchCreateQueryKey() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const name = "An API key granting read-only access to the documents collection of an index."; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.queryKeys.create(resourceGroupName, searchServiceName, name); + console.log(result); +} + +async function main() { + searchCreateQueryKey(); +} + +main().catch(console.error); diff --git a/sdk/search/arm-search/samples/v3-beta/javascript/queryKeysDeleteSample.js b/sdk/search/arm-search/samples/v3-beta/javascript/queryKeysDeleteSample.js new file mode 100644 index 000000000000..91f9471c14a8 --- /dev/null +++ b/sdk/search/arm-search/samples/v3-beta/javascript/queryKeysDeleteSample.js @@ -0,0 +1,36 @@ +/* + * 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. +const { SearchManagementClient } = require("@azure/arm-search"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Deletes the specified query key. Unlike admin keys, query keys are not regenerated. The process for regenerating a query key is to delete and then recreate it. + * + * @summary Deletes the specified query key. Unlike admin keys, query keys are not regenerated. The process for regenerating a query key is to delete and then recreate it. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchDeleteQueryKey.json + */ +async function searchDeleteQueryKey() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const key = ""; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.queryKeys.delete(resourceGroupName, searchServiceName, key); + console.log(result); +} + +async function main() { + searchDeleteQueryKey(); +} + +main().catch(console.error); diff --git a/sdk/search/arm-search/samples/v3-beta/javascript/queryKeysListBySearchServiceSample.js b/sdk/search/arm-search/samples/v3-beta/javascript/queryKeysListBySearchServiceSample.js new file mode 100644 index 000000000000..96429be50e9c --- /dev/null +++ b/sdk/search/arm-search/samples/v3-beta/javascript/queryKeysListBySearchServiceSample.js @@ -0,0 +1,41 @@ +/* + * 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. +const { SearchManagementClient } = require("@azure/arm-search"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Returns the list of query API keys for the given Azure AI Search service. + * + * @summary Returns the list of query API keys for the given Azure AI Search service. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchListQueryKeysBySearchService.json + */ +async function searchListQueryKeysBySearchService() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.queryKeys.listBySearchService( + resourceGroupName, + searchServiceName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + searchListQueryKeysBySearchService(); +} + +main().catch(console.error); diff --git a/sdk/search/arm-search/samples/v3-beta/javascript/sample.env b/sdk/search/arm-search/samples/v3-beta/javascript/sample.env new file mode 100644 index 000000000000..672847a3fea0 --- /dev/null +++ b/sdk/search/arm-search/samples/v3-beta/javascript/sample.env @@ -0,0 +1,4 @@ +# App registration secret for AAD authentication +AZURE_CLIENT_SECRET= +AZURE_CLIENT_ID= +AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/search/arm-search/samples/v3-beta/javascript/servicesCheckNameAvailabilitySample.js b/sdk/search/arm-search/samples/v3-beta/javascript/servicesCheckNameAvailabilitySample.js new file mode 100644 index 000000000000..a15fbbe68292 --- /dev/null +++ b/sdk/search/arm-search/samples/v3-beta/javascript/servicesCheckNameAvailabilitySample.js @@ -0,0 +1,34 @@ +/* + * 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. +const { SearchManagementClient } = require("@azure/arm-search"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Checks whether or not the given search service name is available for use. Search service names must be globally unique since they are part of the service URI (https://.search.windows.net). + * + * @summary Checks whether or not the given search service name is available for use. Search service names must be globally unique since they are part of the service URI (https://.search.windows.net). + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCheckNameAvailability.json + */ +async function searchCheckNameAvailability() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const name = "mysearchservice"; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.services.checkNameAvailability(name); + console.log(result); +} + +async function main() { + searchCheckNameAvailability(); +} + +main().catch(console.error); diff --git a/sdk/search/arm-search/samples/v3-beta/javascript/servicesCreateOrUpdateSample.js b/sdk/search/arm-search/samples/v3-beta/javascript/servicesCreateOrUpdateSample.js new file mode 100644 index 000000000000..0586ee5ed7e4 --- /dev/null +++ b/sdk/search/arm-search/samples/v3-beta/javascript/servicesCreateOrUpdateSample.js @@ -0,0 +1,330 @@ +/* + * 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. +const { SearchManagementClient } = require("@azure/arm-search"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. + * + * @summary Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateService.json + */ +async function searchCreateOrUpdateService() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const service = { + hostingMode: "default", + location: "westus", + partitionCount: 1, + replicaCount: 3, + sku: { name: "standard" }, + tags: { appName: "My e-commerce app" }, + }; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.services.beginCreateOrUpdateAndWait( + resourceGroupName, + searchServiceName, + service, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. + * + * @summary Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceAuthOptions.json + */ +async function searchCreateOrUpdateServiceAuthOptions() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const service = { + authOptions: { + aadOrApiKey: { aadAuthFailureMode: "http401WithBearerChallenge" }, + }, + hostingMode: "default", + location: "westus", + partitionCount: 1, + replicaCount: 3, + sku: { name: "standard" }, + tags: { appName: "My e-commerce app" }, + }; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.services.beginCreateOrUpdateAndWait( + resourceGroupName, + searchServiceName, + service, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. + * + * @summary Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceDisableLocalAuth.json + */ +async function searchCreateOrUpdateServiceDisableLocalAuth() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const service = { + disableLocalAuth: true, + hostingMode: "default", + location: "westus", + partitionCount: 1, + replicaCount: 3, + sku: { name: "standard" }, + tags: { appName: "My e-commerce app" }, + }; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.services.beginCreateOrUpdateAndWait( + resourceGroupName, + searchServiceName, + service, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. + * + * @summary Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceToAllowAccessFromPrivateEndpoints.json + */ +async function searchCreateOrUpdateServiceToAllowAccessFromPrivateEndpoints() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const service = { + hostingMode: "default", + location: "westus", + partitionCount: 1, + publicNetworkAccess: "disabled", + replicaCount: 3, + sku: { name: "standard" }, + tags: { appName: "My e-commerce app" }, + }; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.services.beginCreateOrUpdateAndWait( + resourceGroupName, + searchServiceName, + service, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. + * + * @summary Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPs.json + */ +async function searchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPs() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const service = { + hostingMode: "default", + location: "westus", + networkRuleSet: { + ipRules: [{ value: "123.4.5.6" }, { value: "123.4.6.0/18" }], + }, + partitionCount: 1, + replicaCount: 1, + sku: { name: "standard" }, + tags: { appName: "My e-commerce app" }, + }; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.services.beginCreateOrUpdateAndWait( + resourceGroupName, + searchServiceName, + service, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. + * + * @summary Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass.json + */ +async function searchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const service = { + hostingMode: "default", + location: "westus", + networkRuleSet: { + bypass: "AzurePortal", + ipRules: [{ value: "123.4.5.6" }, { value: "123.4.6.0/18" }], + }, + partitionCount: 1, + replicaCount: 1, + sku: { name: "standard" }, + tags: { appName: "My e-commerce app" }, + }; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.services.beginCreateOrUpdateAndWait( + resourceGroupName, + searchServiceName, + service, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. + * + * @summary Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceWithCmkEnforcement.json + */ +async function searchCreateOrUpdateServiceWithCmkEnforcement() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const service = { + encryptionWithCmk: { enforcement: "Enabled" }, + hostingMode: "default", + location: "westus", + partitionCount: 1, + replicaCount: 3, + sku: { name: "standard" }, + tags: { appName: "My e-commerce app" }, + }; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.services.beginCreateOrUpdateAndWait( + resourceGroupName, + searchServiceName, + service, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. + * + * @summary Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceWithDataExfiltration.json + */ +async function searchCreateOrUpdateServiceWithDataExfiltration() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const service = { + disabledDataExfiltrationOptions: ["All"], + hostingMode: "default", + location: "westus", + partitionCount: 1, + replicaCount: 3, + sku: { name: "standard" }, + tags: { appName: "My e-commerce app" }, + }; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.services.beginCreateOrUpdateAndWait( + resourceGroupName, + searchServiceName, + service, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. + * + * @summary Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceWithIdentity.json + */ +async function searchCreateOrUpdateServiceWithIdentity() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const service = { + hostingMode: "default", + identity: { + type: "SystemAssigned, UserAssigned", + userAssignedIdentities: { + "/subscriptions/00000000000000000000000000000000/resourcegroups/rg1/providers/MicrosoftManagedIdentity/userAssignedIdentities/userMi": + {}, + }, + }, + location: "westus", + partitionCount: 1, + replicaCount: 3, + sku: { name: "standard" }, + tags: { appName: "My e-commerce app" }, + }; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.services.beginCreateOrUpdateAndWait( + resourceGroupName, + searchServiceName, + service, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. + * + * @summary Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateWithSemanticSearch.json + */ +async function searchCreateOrUpdateWithSemanticSearch() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const service = { + hostingMode: "default", + location: "westus", + partitionCount: 1, + replicaCount: 3, + semanticSearch: "free", + sku: { name: "standard" }, + tags: { appName: "My e-commerce app" }, + }; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.services.beginCreateOrUpdateAndWait( + resourceGroupName, + searchServiceName, + service, + ); + console.log(result); +} + +async function main() { + searchCreateOrUpdateService(); + searchCreateOrUpdateServiceAuthOptions(); + searchCreateOrUpdateServiceDisableLocalAuth(); + searchCreateOrUpdateServiceToAllowAccessFromPrivateEndpoints(); + searchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPs(); + searchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass(); + searchCreateOrUpdateServiceWithCmkEnforcement(); + searchCreateOrUpdateServiceWithDataExfiltration(); + searchCreateOrUpdateServiceWithIdentity(); + searchCreateOrUpdateWithSemanticSearch(); +} + +main().catch(console.error); diff --git a/sdk/search/arm-search/samples/v3-beta/javascript/servicesDeleteSample.js b/sdk/search/arm-search/samples/v3-beta/javascript/servicesDeleteSample.js new file mode 100644 index 000000000000..eb91fbbb59e0 --- /dev/null +++ b/sdk/search/arm-search/samples/v3-beta/javascript/servicesDeleteSample.js @@ -0,0 +1,35 @@ +/* + * 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. +const { SearchManagementClient } = require("@azure/arm-search"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Deletes a search service in the given resource group, along with its associated resources. + * + * @summary Deletes a search service in the given resource group, along with its associated resources. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchDeleteService.json + */ +async function searchDeleteService() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.services.delete(resourceGroupName, searchServiceName); + console.log(result); +} + +async function main() { + searchDeleteService(); +} + +main().catch(console.error); diff --git a/sdk/search/arm-search/samples/v3-beta/javascript/servicesGetSample.js b/sdk/search/arm-search/samples/v3-beta/javascript/servicesGetSample.js new file mode 100644 index 000000000000..11993ebbb11a --- /dev/null +++ b/sdk/search/arm-search/samples/v3-beta/javascript/servicesGetSample.js @@ -0,0 +1,35 @@ +/* + * 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. +const { SearchManagementClient } = require("@azure/arm-search"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Gets the search service with the given name in the given resource group. + * + * @summary Gets the search service with the given name in the given resource group. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchGetService.json + */ +async function searchGetService() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.services.get(resourceGroupName, searchServiceName); + console.log(result); +} + +async function main() { + searchGetService(); +} + +main().catch(console.error); diff --git a/sdk/search/arm-search/samples/v3-beta/javascript/servicesListByResourceGroupSample.js b/sdk/search/arm-search/samples/v3-beta/javascript/servicesListByResourceGroupSample.js new file mode 100644 index 000000000000..9b71d08b27cc --- /dev/null +++ b/sdk/search/arm-search/samples/v3-beta/javascript/servicesListByResourceGroupSample.js @@ -0,0 +1,37 @@ +/* + * 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. +const { SearchManagementClient } = require("@azure/arm-search"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Gets a list of all Search services in the given resource group. + * + * @summary Gets a list of all Search services in the given resource group. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchListServicesByResourceGroup.json + */ +async function searchListServicesByResourceGroup() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.services.listByResourceGroup(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + searchListServicesByResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/search/arm-search/samples/v3-beta/javascript/servicesListBySubscriptionSample.js b/sdk/search/arm-search/samples/v3-beta/javascript/servicesListBySubscriptionSample.js new file mode 100644 index 000000000000..39658e5fc05e --- /dev/null +++ b/sdk/search/arm-search/samples/v3-beta/javascript/servicesListBySubscriptionSample.js @@ -0,0 +1,36 @@ +/* + * 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. +const { SearchManagementClient } = require("@azure/arm-search"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Gets a list of all Search services in the given subscription. + * + * @summary Gets a list of all Search services in the given subscription. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchListServicesBySubscription.json + */ +async function searchListServicesBySubscription() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.services.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + searchListServicesBySubscription(); +} + +main().catch(console.error); diff --git a/sdk/search/arm-search/samples/v3-beta/javascript/servicesUpdateSample.js b/sdk/search/arm-search/samples/v3-beta/javascript/servicesUpdateSample.js new file mode 100644 index 000000000000..046ce643d6aa --- /dev/null +++ b/sdk/search/arm-search/samples/v3-beta/javascript/servicesUpdateSample.js @@ -0,0 +1,245 @@ +/* + * 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. +const { SearchManagementClient } = require("@azure/arm-search"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Updates an existing search service in the given resource group. + * + * @summary Updates an existing search service in the given resource group. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateService.json + */ +async function searchUpdateService() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const service = { + replicaCount: 2, + tags: { appName: "My e-commerce app", newTag: "Adding a new tag" }, + }; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.services.update(resourceGroupName, searchServiceName, service); + console.log(result); +} + +/** + * This sample demonstrates how to Updates an existing search service in the given resource group. + * + * @summary Updates an existing search service in the given resource group. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceAuthOptions.json + */ +async function searchUpdateServiceAuthOptions() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const service = { + authOptions: { + aadOrApiKey: { aadAuthFailureMode: "http401WithBearerChallenge" }, + }, + replicaCount: 2, + tags: { appName: "My e-commerce app", newTag: "Adding a new tag" }, + }; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.services.update(resourceGroupName, searchServiceName, service); + console.log(result); +} + +/** + * This sample demonstrates how to Updates an existing search service in the given resource group. + * + * @summary Updates an existing search service in the given resource group. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceDisableLocalAuth.json + */ +async function searchUpdateServiceDisableLocalAuth() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const service = { + disableLocalAuth: true, + replicaCount: 2, + tags: { appName: "My e-commerce app", newTag: "Adding a new tag" }, + }; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.services.update(resourceGroupName, searchServiceName, service); + console.log(result); +} + +/** + * This sample demonstrates how to Updates an existing search service in the given resource group. + * + * @summary Updates an existing search service in the given resource group. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceToAllowAccessFromPrivateEndpoints.json + */ +async function searchUpdateServiceToAllowAccessFromPrivateEndpoints() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const service = { + partitionCount: 1, + publicNetworkAccess: "disabled", + replicaCount: 1, + }; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.services.update(resourceGroupName, searchServiceName, service); + console.log(result); +} + +/** + * This sample demonstrates how to Updates an existing search service in the given resource group. + * + * @summary Updates an existing search service in the given resource group. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceToAllowAccessFromPublicCustomIPs.json + */ +async function searchUpdateServiceToAllowAccessFromPublicCustomIPs() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const service = { + networkRuleSet: { + ipRules: [{ value: "123.4.5.6" }, { value: "123.4.6.0/18" }], + }, + partitionCount: 1, + publicNetworkAccess: "enabled", + replicaCount: 3, + }; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.services.update(resourceGroupName, searchServiceName, service); + console.log(result); +} + +/** + * This sample demonstrates how to Updates an existing search service in the given resource group. + * + * @summary Updates an existing search service in the given resource group. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass.json + */ +async function searchUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const service = { + networkRuleSet: { + bypass: "AzurePortal", + ipRules: [{ value: "123.4.5.6" }, { value: "123.4.6.0/18" }], + }, + partitionCount: 1, + publicNetworkAccess: "enabled", + replicaCount: 3, + }; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.services.update(resourceGroupName, searchServiceName, service); + console.log(result); +} + +/** + * This sample demonstrates how to Updates an existing search service in the given resource group. + * + * @summary Updates an existing search service in the given resource group. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceToRemoveIdentity.json + */ +async function searchUpdateServiceToRemoveIdentity() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const service = { + identity: { type: "None" }, + sku: { name: "standard" }, + }; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.services.update(resourceGroupName, searchServiceName, service); + console.log(result); +} + +/** + * This sample demonstrates how to Updates an existing search service in the given resource group. + * + * @summary Updates an existing search service in the given resource group. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceWithCmkEnforcement.json + */ +async function searchUpdateServiceWithCmkEnforcement() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const service = { + encryptionWithCmk: { enforcement: "Enabled" }, + replicaCount: 2, + tags: { appName: "My e-commerce app", newTag: "Adding a new tag" }, + }; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.services.update(resourceGroupName, searchServiceName, service); + console.log(result); +} + +/** + * This sample demonstrates how to Updates an existing search service in the given resource group. + * + * @summary Updates an existing search service in the given resource group. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceWithDataExfiltration.json + */ +async function searchUpdateServiceWithDataExfiltration() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const service = { + disabledDataExfiltrationOptions: ["All"], + replicaCount: 2, + tags: { appName: "My e-commerce app", newTag: "Adding a new tag" }, + }; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.services.update(resourceGroupName, searchServiceName, service); + console.log(result); +} + +/** + * This sample demonstrates how to Updates an existing search service in the given resource group. + * + * @summary Updates an existing search service in the given resource group. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceWithSemanticSearch.json + */ +async function searchUpdateServiceWithSemanticSearch() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const service = { + replicaCount: 2, + semanticSearch: "standard", + tags: { appName: "My e-commerce app", newTag: "Adding a new tag" }, + }; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.services.update(resourceGroupName, searchServiceName, service); + console.log(result); +} + +async function main() { + searchUpdateService(); + searchUpdateServiceAuthOptions(); + searchUpdateServiceDisableLocalAuth(); + searchUpdateServiceToAllowAccessFromPrivateEndpoints(); + searchUpdateServiceToAllowAccessFromPublicCustomIPs(); + searchUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass(); + searchUpdateServiceToRemoveIdentity(); + searchUpdateServiceWithCmkEnforcement(); + searchUpdateServiceWithDataExfiltration(); + searchUpdateServiceWithSemanticSearch(); +} + +main().catch(console.error); diff --git a/sdk/search/arm-search/samples/v3-beta/javascript/sharedPrivateLinkResourcesCreateOrUpdateSample.js b/sdk/search/arm-search/samples/v3-beta/javascript/sharedPrivateLinkResourcesCreateOrUpdateSample.js new file mode 100644 index 000000000000..640164c7347f --- /dev/null +++ b/sdk/search/arm-search/samples/v3-beta/javascript/sharedPrivateLinkResourcesCreateOrUpdateSample.js @@ -0,0 +1,50 @@ +/* + * 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. +const { SearchManagementClient } = require("@azure/arm-search"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Initiates the creation or update of a shared private link resource managed by the search service in the given resource group. + * + * @summary Initiates the creation or update of a shared private link resource managed by the search service in the given resource group. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/CreateOrUpdateSharedPrivateLinkResource.json + */ +async function sharedPrivateLinkResourceCreateOrUpdate() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const sharedPrivateLinkResourceName = "testResource"; + const sharedPrivateLinkResource = { + properties: { + groupId: "blob", + privateLinkResourceId: + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/storageAccountName", + requestMessage: "please approve", + resourceRegion: undefined, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.sharedPrivateLinkResources.beginCreateOrUpdateAndWait( + resourceGroupName, + searchServiceName, + sharedPrivateLinkResourceName, + sharedPrivateLinkResource, + ); + console.log(result); +} + +async function main() { + sharedPrivateLinkResourceCreateOrUpdate(); +} + +main().catch(console.error); diff --git a/sdk/search/arm-search/samples/v3-beta/javascript/sharedPrivateLinkResourcesDeleteSample.js b/sdk/search/arm-search/samples/v3-beta/javascript/sharedPrivateLinkResourcesDeleteSample.js new file mode 100644 index 000000000000..b3d7d6301b0a --- /dev/null +++ b/sdk/search/arm-search/samples/v3-beta/javascript/sharedPrivateLinkResourcesDeleteSample.js @@ -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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SearchManagementClient } = require("@azure/arm-search"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Initiates the deletion of the shared private link resource from the search service. + * + * @summary Initiates the deletion of the shared private link resource from the search service. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/DeleteSharedPrivateLinkResource.json + */ +async function sharedPrivateLinkResourceDelete() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const sharedPrivateLinkResourceName = "testResource"; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.sharedPrivateLinkResources.beginDeleteAndWait( + resourceGroupName, + searchServiceName, + sharedPrivateLinkResourceName, + ); + console.log(result); +} + +async function main() { + sharedPrivateLinkResourceDelete(); +} + +main().catch(console.error); diff --git a/sdk/search/arm-search/samples/v3-beta/javascript/sharedPrivateLinkResourcesGetSample.js b/sdk/search/arm-search/samples/v3-beta/javascript/sharedPrivateLinkResourcesGetSample.js new file mode 100644 index 000000000000..2cfbc0b88b82 --- /dev/null +++ b/sdk/search/arm-search/samples/v3-beta/javascript/sharedPrivateLinkResourcesGetSample.js @@ -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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SearchManagementClient } = require("@azure/arm-search"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Gets the details of the shared private link resource managed by the search service in the given resource group. + * + * @summary Gets the details of the shared private link resource managed by the search service in the given resource group. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/GetSharedPrivateLinkResource.json + */ +async function sharedPrivateLinkResourceGet() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const sharedPrivateLinkResourceName = "testResource"; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.sharedPrivateLinkResources.get( + resourceGroupName, + searchServiceName, + sharedPrivateLinkResourceName, + ); + console.log(result); +} + +async function main() { + sharedPrivateLinkResourceGet(); +} + +main().catch(console.error); diff --git a/sdk/search/arm-search/samples/v3-beta/javascript/sharedPrivateLinkResourcesListByServiceSample.js b/sdk/search/arm-search/samples/v3-beta/javascript/sharedPrivateLinkResourcesListByServiceSample.js new file mode 100644 index 000000000000..0d31b345639f --- /dev/null +++ b/sdk/search/arm-search/samples/v3-beta/javascript/sharedPrivateLinkResourcesListByServiceSample.js @@ -0,0 +1,41 @@ +/* + * 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. +const { SearchManagementClient } = require("@azure/arm-search"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Gets a list of all shared private link resources managed by the given service. + * + * @summary Gets a list of all shared private link resources managed by the given service. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/ListSharedPrivateLinkResourcesByService.json + */ +async function listSharedPrivateLinkResourcesByService() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.sharedPrivateLinkResources.listByService( + resourceGroupName, + searchServiceName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listSharedPrivateLinkResourcesByService(); +} + +main().catch(console.error); diff --git a/sdk/search/arm-search/samples/v3-beta/javascript/usageBySubscriptionSkuSample.js b/sdk/search/arm-search/samples/v3-beta/javascript/usageBySubscriptionSkuSample.js new file mode 100644 index 000000000000..aa940b8698b0 --- /dev/null +++ b/sdk/search/arm-search/samples/v3-beta/javascript/usageBySubscriptionSkuSample.js @@ -0,0 +1,35 @@ +/* + * 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. +const { SearchManagementClient } = require("@azure/arm-search"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Gets the quota usage for a search sku in the given subscription. + * + * @summary Gets the quota usage for a search sku in the given subscription. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/GetQuotaUsage.json + */ +async function getQuotaUsage() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const location = "westus"; + const skuName = "free"; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.usageBySubscriptionSku(location, skuName); + console.log(result); +} + +async function main() { + getQuotaUsage(); +} + +main().catch(console.error); diff --git a/sdk/search/arm-search/samples/v3-beta/javascript/usagesListBySubscriptionSample.js b/sdk/search/arm-search/samples/v3-beta/javascript/usagesListBySubscriptionSample.js new file mode 100644 index 000000000000..e4b6054ced52 --- /dev/null +++ b/sdk/search/arm-search/samples/v3-beta/javascript/usagesListBySubscriptionSample.js @@ -0,0 +1,37 @@ +/* + * 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. +const { SearchManagementClient } = require("@azure/arm-search"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get a list of all Azure AI Search quota usages across the subscription. + * + * @summary Get a list of all Azure AI Search quota usages across the subscription. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/GetQuotaUsagesList.json + */ +async function getQuotaUsagesList() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const location = "westus"; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.usages.listBySubscription(location)) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + getQuotaUsagesList(); +} + +main().catch(console.error); diff --git a/sdk/search/arm-search/samples/v3-beta/typescript/README.md b/sdk/search/arm-search/samples/v3-beta/typescript/README.md new file mode 100644 index 000000000000..c57256d5b101 --- /dev/null +++ b/sdk/search/arm-search/samples/v3-beta/typescript/README.md @@ -0,0 +1,115 @@ +# client library samples for TypeScript (Beta) + +These sample programs show how to use the TypeScript client libraries for in some common scenarios. + +| **File Name** | **Description** | +| ------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [adminKeysGetSample.ts][adminkeysgetsample] | Gets the primary and secondary admin API keys for the specified Azure AI Search service. x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchGetAdminKeys.json | +| [adminKeysRegenerateSample.ts][adminkeysregeneratesample] | Regenerates either the primary or secondary admin API key. You can only regenerate one key at a time. x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchRegenerateAdminKey.json | +| [networkSecurityPerimeterConfigurationsGetSample.ts][networksecurityperimeterconfigurationsgetsample] | Gets a network security perimeter configuration. x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/NetworkSecurityPerimeterConfigurationsGet.json | +| [networkSecurityPerimeterConfigurationsListByServiceSample.ts][networksecurityperimeterconfigurationslistbyservicesample] | Gets a list of network security perimeter configurations for a search service. x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/NetworkSecurityPerimeterConfigurationsListByService.json | +| [networkSecurityPerimeterConfigurationsReconcileSample.ts][networksecurityperimeterconfigurationsreconcilesample] | Reconcile network security perimeter configuration for the Azure AI Search resource provider. This triggers a manual resync with network security perimeter configurations by ensuring the search service carries the latest configuration. x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/NetworkSecurityPerimeterConfigurationsReconcile.json | +| [operationsListSample.ts][operationslistsample] | Lists all of the available REST API operations of the Microsoft.Search provider. x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchListOperations.json | +| [privateEndpointConnectionsDeleteSample.ts][privateendpointconnectionsdeletesample] | Disconnects the private endpoint connection and deletes it from the search service. x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/DeletePrivateEndpointConnection.json | +| [privateEndpointConnectionsGetSample.ts][privateendpointconnectionsgetsample] | Gets the details of the private endpoint connection to the search service in the given resource group. x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/GetPrivateEndpointConnection.json | +| [privateEndpointConnectionsListByServiceSample.ts][privateendpointconnectionslistbyservicesample] | Gets a list of all private endpoint connections in the given service. x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/ListPrivateEndpointConnectionsByService.json | +| [privateEndpointConnectionsUpdateSample.ts][privateendpointconnectionsupdatesample] | Updates a private endpoint connection to the search service in the given resource group. x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/UpdatePrivateEndpointConnection.json | +| [privateLinkResourcesListSupportedSample.ts][privatelinkresourceslistsupportedsample] | Gets a list of all supported private link resource types for the given service. x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/ListSupportedPrivateLinkResources.json | +| [queryKeysCreateSample.ts][querykeyscreatesample] | Generates a new query key for the specified search service. You can create up to 50 query keys per service. x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateQueryKey.json | +| [queryKeysDeleteSample.ts][querykeysdeletesample] | Deletes the specified query key. Unlike admin keys, query keys are not regenerated. The process for regenerating a query key is to delete and then recreate it. x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchDeleteQueryKey.json | +| [queryKeysListBySearchServiceSample.ts][querykeyslistbysearchservicesample] | Returns the list of query API keys for the given Azure AI Search service. x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchListQueryKeysBySearchService.json | +| [servicesCheckNameAvailabilitySample.ts][serviceschecknameavailabilitysample] | Checks whether or not the given search service name is available for use. Search service names must be globally unique since they are part of the service URI (https://.search.windows.net). x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCheckNameAvailability.json | +| [servicesCreateOrUpdateSample.ts][servicescreateorupdatesample] | Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateService.json | +| [servicesDeleteSample.ts][servicesdeletesample] | Deletes a search service in the given resource group, along with its associated resources. x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchDeleteService.json | +| [servicesGetSample.ts][servicesgetsample] | Gets the search service with the given name in the given resource group. x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchGetService.json | +| [servicesListByResourceGroupSample.ts][serviceslistbyresourcegroupsample] | Gets a list of all Search services in the given resource group. x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchListServicesByResourceGroup.json | +| [servicesListBySubscriptionSample.ts][serviceslistbysubscriptionsample] | Gets a list of all Search services in the given subscription. x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchListServicesBySubscription.json | +| [servicesUpdateSample.ts][servicesupdatesample] | Updates an existing search service in the given resource group. x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateService.json | +| [sharedPrivateLinkResourcesCreateOrUpdateSample.ts][sharedprivatelinkresourcescreateorupdatesample] | Initiates the creation or update of a shared private link resource managed by the search service in the given resource group. x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/CreateOrUpdateSharedPrivateLinkResource.json | +| [sharedPrivateLinkResourcesDeleteSample.ts][sharedprivatelinkresourcesdeletesample] | Initiates the deletion of the shared private link resource from the search service. x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/DeleteSharedPrivateLinkResource.json | +| [sharedPrivateLinkResourcesGetSample.ts][sharedprivatelinkresourcesgetsample] | Gets the details of the shared private link resource managed by the search service in the given resource group. x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/GetSharedPrivateLinkResource.json | +| [sharedPrivateLinkResourcesListByServiceSample.ts][sharedprivatelinkresourceslistbyservicesample] | Gets a list of all shared private link resources managed by the given service. x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/ListSharedPrivateLinkResourcesByService.json | +| [usageBySubscriptionSkuSample.ts][usagebysubscriptionskusample] | Gets the quota usage for a search sku in the given subscription. x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/GetQuotaUsage.json | +| [usagesListBySubscriptionSample.ts][usageslistbysubscriptionsample] | Get a list of all Azure AI Search quota usages across the subscription. x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/GetQuotaUsagesList.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/adminKeysGetSample.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 cross-env SEARCH_SUBSCRIPTION_ID="" SEARCH_RESOURCE_GROUP="" node dist/adminKeysGetSample.js +``` + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +[adminkeysgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/arm-search/samples/v3-beta/typescript/src/adminKeysGetSample.ts +[adminkeysregeneratesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/arm-search/samples/v3-beta/typescript/src/adminKeysRegenerateSample.ts +[networksecurityperimeterconfigurationsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/arm-search/samples/v3-beta/typescript/src/networkSecurityPerimeterConfigurationsGetSample.ts +[networksecurityperimeterconfigurationslistbyservicesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/arm-search/samples/v3-beta/typescript/src/networkSecurityPerimeterConfigurationsListByServiceSample.ts +[networksecurityperimeterconfigurationsreconcilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/arm-search/samples/v3-beta/typescript/src/networkSecurityPerimeterConfigurationsReconcileSample.ts +[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/arm-search/samples/v3-beta/typescript/src/operationsListSample.ts +[privateendpointconnectionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/arm-search/samples/v3-beta/typescript/src/privateEndpointConnectionsDeleteSample.ts +[privateendpointconnectionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/arm-search/samples/v3-beta/typescript/src/privateEndpointConnectionsGetSample.ts +[privateendpointconnectionslistbyservicesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/arm-search/samples/v3-beta/typescript/src/privateEndpointConnectionsListByServiceSample.ts +[privateendpointconnectionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/arm-search/samples/v3-beta/typescript/src/privateEndpointConnectionsUpdateSample.ts +[privatelinkresourceslistsupportedsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/arm-search/samples/v3-beta/typescript/src/privateLinkResourcesListSupportedSample.ts +[querykeyscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/arm-search/samples/v3-beta/typescript/src/queryKeysCreateSample.ts +[querykeysdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/arm-search/samples/v3-beta/typescript/src/queryKeysDeleteSample.ts +[querykeyslistbysearchservicesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/arm-search/samples/v3-beta/typescript/src/queryKeysListBySearchServiceSample.ts +[serviceschecknameavailabilitysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/arm-search/samples/v3-beta/typescript/src/servicesCheckNameAvailabilitySample.ts +[servicescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/arm-search/samples/v3-beta/typescript/src/servicesCreateOrUpdateSample.ts +[servicesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/arm-search/samples/v3-beta/typescript/src/servicesDeleteSample.ts +[servicesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/arm-search/samples/v3-beta/typescript/src/servicesGetSample.ts +[serviceslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/arm-search/samples/v3-beta/typescript/src/servicesListByResourceGroupSample.ts +[serviceslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/arm-search/samples/v3-beta/typescript/src/servicesListBySubscriptionSample.ts +[servicesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/arm-search/samples/v3-beta/typescript/src/servicesUpdateSample.ts +[sharedprivatelinkresourcescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/arm-search/samples/v3-beta/typescript/src/sharedPrivateLinkResourcesCreateOrUpdateSample.ts +[sharedprivatelinkresourcesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/arm-search/samples/v3-beta/typescript/src/sharedPrivateLinkResourcesDeleteSample.ts +[sharedprivatelinkresourcesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/arm-search/samples/v3-beta/typescript/src/sharedPrivateLinkResourcesGetSample.ts +[sharedprivatelinkresourceslistbyservicesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/arm-search/samples/v3-beta/typescript/src/sharedPrivateLinkResourcesListByServiceSample.ts +[usagebysubscriptionskusample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/arm-search/samples/v3-beta/typescript/src/usageBySubscriptionSkuSample.ts +[usageslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/arm-search/samples/v3-beta/typescript/src/usagesListBySubscriptionSample.ts +[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-search?view=azure-node-preview +[freesub]: https://azure.microsoft.com/free/ +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/search/arm-search/README.md +[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/search/arm-search/samples/v3-beta/typescript/package.json b/sdk/search/arm-search/samples/v3-beta/typescript/package.json new file mode 100644 index 000000000000..c148413f633f --- /dev/null +++ b/sdk/search/arm-search/samples/v3-beta/typescript/package.json @@ -0,0 +1,41 @@ +{ + "name": "@azure-samples/arm-search-ts-beta", + "private": true, + "version": "1.0.0", + "description": " 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/search/arm-search" + }, + "keywords": [ + "node", + "azure", + "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/search/arm-search", + "dependencies": { + "@azure/arm-search": "next", + "dotenv": "latest", + "@azure/identity": "^4.0.1" + }, + "devDependencies": { + "@types/node": "^18.0.0", + "typescript": "~5.3.3", + "rimraf": "latest" + } +} diff --git a/sdk/search/arm-search/samples/v3-beta/typescript/sample.env b/sdk/search/arm-search/samples/v3-beta/typescript/sample.env new file mode 100644 index 000000000000..672847a3fea0 --- /dev/null +++ b/sdk/search/arm-search/samples/v3-beta/typescript/sample.env @@ -0,0 +1,4 @@ +# App registration secret for AAD authentication +AZURE_CLIENT_SECRET= +AZURE_CLIENT_ID= +AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/search/arm-search/samples/v3-beta/typescript/src/adminKeysGetSample.ts b/sdk/search/arm-search/samples/v3-beta/typescript/src/adminKeysGetSample.ts new file mode 100644 index 000000000000..81733aafebf8 --- /dev/null +++ b/sdk/search/arm-search/samples/v3-beta/typescript/src/adminKeysGetSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SearchManagementClient } from "@azure/arm-search"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets the primary and secondary admin API keys for the specified Azure AI Search service. + * + * @summary Gets the primary and secondary admin API keys for the specified Azure AI Search service. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchGetAdminKeys.json + */ +async function searchGetAdminKeys() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.adminKeys.get( + resourceGroupName, + searchServiceName, + ); + console.log(result); +} + +async function main() { + searchGetAdminKeys(); +} + +main().catch(console.error); diff --git a/sdk/search/arm-search/samples/v3-beta/typescript/src/adminKeysRegenerateSample.ts b/sdk/search/arm-search/samples/v3-beta/typescript/src/adminKeysRegenerateSample.ts new file mode 100644 index 000000000000..7bfdcce19d4f --- /dev/null +++ b/sdk/search/arm-search/samples/v3-beta/typescript/src/adminKeysRegenerateSample.ts @@ -0,0 +1,42 @@ +/* + * 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 { SearchManagementClient } from "@azure/arm-search"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Regenerates either the primary or secondary admin API key. You can only regenerate one key at a time. + * + * @summary Regenerates either the primary or secondary admin API key. You can only regenerate one key at a time. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchRegenerateAdminKey.json + */ +async function searchRegenerateAdminKey() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const keyKind = "primary"; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.adminKeys.regenerate( + resourceGroupName, + searchServiceName, + keyKind, + ); + console.log(result); +} + +async function main() { + searchRegenerateAdminKey(); +} + +main().catch(console.error); diff --git a/sdk/search/arm-search/samples/v3-beta/typescript/src/networkSecurityPerimeterConfigurationsGetSample.ts b/sdk/search/arm-search/samples/v3-beta/typescript/src/networkSecurityPerimeterConfigurationsGetSample.ts new file mode 100644 index 000000000000..3e90ba68cecc --- /dev/null +++ b/sdk/search/arm-search/samples/v3-beta/typescript/src/networkSecurityPerimeterConfigurationsGetSample.ts @@ -0,0 +1,42 @@ +/* + * 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 { SearchManagementClient } from "@azure/arm-search"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets a network security perimeter configuration. + * + * @summary Gets a network security perimeter configuration. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/NetworkSecurityPerimeterConfigurationsGet.json + */ +async function getAnNspConfigByName() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const nspConfigName = "00000001-2222-3333-4444-111144444444.assoc1"; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.networkSecurityPerimeterConfigurations.get( + resourceGroupName, + searchServiceName, + nspConfigName, + ); + console.log(result); +} + +async function main() { + getAnNspConfigByName(); +} + +main().catch(console.error); diff --git a/sdk/search/arm-search/samples/v3-beta/typescript/src/networkSecurityPerimeterConfigurationsListByServiceSample.ts b/sdk/search/arm-search/samples/v3-beta/typescript/src/networkSecurityPerimeterConfigurationsListByServiceSample.ts new file mode 100644 index 000000000000..feeb6bbab14c --- /dev/null +++ b/sdk/search/arm-search/samples/v3-beta/typescript/src/networkSecurityPerimeterConfigurationsListByServiceSample.ts @@ -0,0 +1,43 @@ +/* + * 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 { SearchManagementClient } from "@azure/arm-search"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets a list of network security perimeter configurations for a search service. + * + * @summary Gets a list of network security perimeter configurations for a search service. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/NetworkSecurityPerimeterConfigurationsListByService.json + */ +async function listNspConfigsBySearchService() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.networkSecurityPerimeterConfigurations.listByService( + resourceGroupName, + searchServiceName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listNspConfigsBySearchService(); +} + +main().catch(console.error); diff --git a/sdk/search/arm-search/samples/v3-beta/typescript/src/networkSecurityPerimeterConfigurationsReconcileSample.ts b/sdk/search/arm-search/samples/v3-beta/typescript/src/networkSecurityPerimeterConfigurationsReconcileSample.ts new file mode 100644 index 000000000000..647222db3231 --- /dev/null +++ b/sdk/search/arm-search/samples/v3-beta/typescript/src/networkSecurityPerimeterConfigurationsReconcileSample.ts @@ -0,0 +1,43 @@ +/* + * 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 { SearchManagementClient } from "@azure/arm-search"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Reconcile network security perimeter configuration for the Azure AI Search resource provider. This triggers a manual resync with network security perimeter configurations by ensuring the search service carries the latest configuration. + * + * @summary Reconcile network security perimeter configuration for the Azure AI Search resource provider. This triggers a manual resync with network security perimeter configurations by ensuring the search service carries the latest configuration. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/NetworkSecurityPerimeterConfigurationsReconcile.json + */ +async function reconcileNspConfig() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const nspConfigName = "00000001-2222-3333-4444-111144444444.assoc1"; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = + await client.networkSecurityPerimeterConfigurations.beginReconcileAndWait( + resourceGroupName, + searchServiceName, + nspConfigName, + ); + console.log(result); +} + +async function main() { + reconcileNspConfig(); +} + +main().catch(console.error); diff --git a/sdk/search/arm-search/samples/v3-beta/typescript/src/operationsListSample.ts b/sdk/search/arm-search/samples/v3-beta/typescript/src/operationsListSample.ts new file mode 100644 index 000000000000..2e38e7a1f140 --- /dev/null +++ b/sdk/search/arm-search/samples/v3-beta/typescript/src/operationsListSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SearchManagementClient } from "@azure/arm-search"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists all of the available REST API operations of the Microsoft.Search provider. + * + * @summary Lists all of the available REST API operations of the Microsoft.Search provider. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchListOperations.json + */ +async function searchListOperations() { + const subscriptionId = + process.env["SEARCH_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.operations.list()) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + searchListOperations(); +} + +main().catch(console.error); diff --git a/sdk/search/arm-search/samples/v3-beta/typescript/src/privateEndpointConnectionsDeleteSample.ts b/sdk/search/arm-search/samples/v3-beta/typescript/src/privateEndpointConnectionsDeleteSample.ts new file mode 100644 index 000000000000..6d492d97979d --- /dev/null +++ b/sdk/search/arm-search/samples/v3-beta/typescript/src/privateEndpointConnectionsDeleteSample.ts @@ -0,0 +1,43 @@ +/* + * 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 { SearchManagementClient } from "@azure/arm-search"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Disconnects the private endpoint connection and deletes it from the search service. + * + * @summary Disconnects the private endpoint connection and deletes it from the search service. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/DeletePrivateEndpointConnection.json + */ +async function privateEndpointConnectionDelete() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const privateEndpointConnectionName = + "testEndpoint.50bf4fbe-d7c1-4b48-a642-4f5892642546"; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.privateEndpointConnections.delete( + resourceGroupName, + searchServiceName, + privateEndpointConnectionName, + ); + console.log(result); +} + +async function main() { + privateEndpointConnectionDelete(); +} + +main().catch(console.error); diff --git a/sdk/search/arm-search/samples/v3-beta/typescript/src/privateEndpointConnectionsGetSample.ts b/sdk/search/arm-search/samples/v3-beta/typescript/src/privateEndpointConnectionsGetSample.ts new file mode 100644 index 000000000000..58f44338e4f3 --- /dev/null +++ b/sdk/search/arm-search/samples/v3-beta/typescript/src/privateEndpointConnectionsGetSample.ts @@ -0,0 +1,43 @@ +/* + * 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 { SearchManagementClient } from "@azure/arm-search"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets the details of the private endpoint connection to the search service in the given resource group. + * + * @summary Gets the details of the private endpoint connection to the search service in the given resource group. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/GetPrivateEndpointConnection.json + */ +async function privateEndpointConnectionGet() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const privateEndpointConnectionName = + "testEndpoint.50bf4fbe-d7c1-4b48-a642-4f5892642546"; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.privateEndpointConnections.get( + resourceGroupName, + searchServiceName, + privateEndpointConnectionName, + ); + console.log(result); +} + +async function main() { + privateEndpointConnectionGet(); +} + +main().catch(console.error); diff --git a/sdk/search/arm-search/samples/v3-beta/typescript/src/privateEndpointConnectionsListByServiceSample.ts b/sdk/search/arm-search/samples/v3-beta/typescript/src/privateEndpointConnectionsListByServiceSample.ts new file mode 100644 index 000000000000..287f544b7b6d --- /dev/null +++ b/sdk/search/arm-search/samples/v3-beta/typescript/src/privateEndpointConnectionsListByServiceSample.ts @@ -0,0 +1,43 @@ +/* + * 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 { SearchManagementClient } from "@azure/arm-search"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets a list of all private endpoint connections in the given service. + * + * @summary Gets a list of all private endpoint connections in the given service. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/ListPrivateEndpointConnectionsByService.json + */ +async function listPrivateEndpointConnectionsByService() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.privateEndpointConnections.listByService( + resourceGroupName, + searchServiceName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listPrivateEndpointConnectionsByService(); +} + +main().catch(console.error); diff --git a/sdk/search/arm-search/samples/v3-beta/typescript/src/privateEndpointConnectionsUpdateSample.ts b/sdk/search/arm-search/samples/v3-beta/typescript/src/privateEndpointConnectionsUpdateSample.ts new file mode 100644 index 000000000000..de3b80a92213 --- /dev/null +++ b/sdk/search/arm-search/samples/v3-beta/typescript/src/privateEndpointConnectionsUpdateSample.ts @@ -0,0 +1,55 @@ +/* + * 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 { + PrivateEndpointConnection, + SearchManagementClient, +} from "@azure/arm-search"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Updates a private endpoint connection to the search service in the given resource group. + * + * @summary Updates a private endpoint connection to the search service in the given resource group. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/UpdatePrivateEndpointConnection.json + */ +async function privateEndpointConnectionUpdate() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const privateEndpointConnectionName = + "testEndpoint.50bf4fbe-d7c1-4b48-a642-4f5892642546"; + const privateEndpointConnection: PrivateEndpointConnection = { + properties: { + privateLinkServiceConnectionState: { + description: "Rejected for some reason.", + status: "Rejected", + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.privateEndpointConnections.update( + resourceGroupName, + searchServiceName, + privateEndpointConnectionName, + privateEndpointConnection, + ); + console.log(result); +} + +async function main() { + privateEndpointConnectionUpdate(); +} + +main().catch(console.error); diff --git a/sdk/search/arm-search/samples/v3-beta/typescript/src/privateLinkResourcesListSupportedSample.ts b/sdk/search/arm-search/samples/v3-beta/typescript/src/privateLinkResourcesListSupportedSample.ts new file mode 100644 index 000000000000..ede3faec04e3 --- /dev/null +++ b/sdk/search/arm-search/samples/v3-beta/typescript/src/privateLinkResourcesListSupportedSample.ts @@ -0,0 +1,43 @@ +/* + * 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 { SearchManagementClient } from "@azure/arm-search"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets a list of all supported private link resource types for the given service. + * + * @summary Gets a list of all supported private link resource types for the given service. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/ListSupportedPrivateLinkResources.json + */ +async function listSupportedPrivateLinkResources() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.privateLinkResources.listSupported( + resourceGroupName, + searchServiceName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listSupportedPrivateLinkResources(); +} + +main().catch(console.error); diff --git a/sdk/search/arm-search/samples/v3-beta/typescript/src/queryKeysCreateSample.ts b/sdk/search/arm-search/samples/v3-beta/typescript/src/queryKeysCreateSample.ts new file mode 100644 index 000000000000..ceb045cfdcb7 --- /dev/null +++ b/sdk/search/arm-search/samples/v3-beta/typescript/src/queryKeysCreateSample.ts @@ -0,0 +1,43 @@ +/* + * 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 { SearchManagementClient } from "@azure/arm-search"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Generates a new query key for the specified search service. You can create up to 50 query keys per service. + * + * @summary Generates a new query key for the specified search service. You can create up to 50 query keys per service. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateQueryKey.json + */ +async function searchCreateQueryKey() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const name = + "An API key granting read-only access to the documents collection of an index."; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.queryKeys.create( + resourceGroupName, + searchServiceName, + name, + ); + console.log(result); +} + +async function main() { + searchCreateQueryKey(); +} + +main().catch(console.error); diff --git a/sdk/search/arm-search/samples/v3-beta/typescript/src/queryKeysDeleteSample.ts b/sdk/search/arm-search/samples/v3-beta/typescript/src/queryKeysDeleteSample.ts new file mode 100644 index 000000000000..1bb57af82d39 --- /dev/null +++ b/sdk/search/arm-search/samples/v3-beta/typescript/src/queryKeysDeleteSample.ts @@ -0,0 +1,42 @@ +/* + * 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 { SearchManagementClient } from "@azure/arm-search"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Deletes the specified query key. Unlike admin keys, query keys are not regenerated. The process for regenerating a query key is to delete and then recreate it. + * + * @summary Deletes the specified query key. Unlike admin keys, query keys are not regenerated. The process for regenerating a query key is to delete and then recreate it. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchDeleteQueryKey.json + */ +async function searchDeleteQueryKey() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const key = ""; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.queryKeys.delete( + resourceGroupName, + searchServiceName, + key, + ); + console.log(result); +} + +async function main() { + searchDeleteQueryKey(); +} + +main().catch(console.error); diff --git a/sdk/search/arm-search/samples/v3-beta/typescript/src/queryKeysListBySearchServiceSample.ts b/sdk/search/arm-search/samples/v3-beta/typescript/src/queryKeysListBySearchServiceSample.ts new file mode 100644 index 000000000000..f5f9534d4918 --- /dev/null +++ b/sdk/search/arm-search/samples/v3-beta/typescript/src/queryKeysListBySearchServiceSample.ts @@ -0,0 +1,43 @@ +/* + * 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 { SearchManagementClient } from "@azure/arm-search"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Returns the list of query API keys for the given Azure AI Search service. + * + * @summary Returns the list of query API keys for the given Azure AI Search service. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchListQueryKeysBySearchService.json + */ +async function searchListQueryKeysBySearchService() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.queryKeys.listBySearchService( + resourceGroupName, + searchServiceName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + searchListQueryKeysBySearchService(); +} + +main().catch(console.error); diff --git a/sdk/search/arm-search/samples/v3-beta/typescript/src/servicesCheckNameAvailabilitySample.ts b/sdk/search/arm-search/samples/v3-beta/typescript/src/servicesCheckNameAvailabilitySample.ts new file mode 100644 index 000000000000..4323782dcc95 --- /dev/null +++ b/sdk/search/arm-search/samples/v3-beta/typescript/src/servicesCheckNameAvailabilitySample.ts @@ -0,0 +1,36 @@ +/* + * 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 { SearchManagementClient } from "@azure/arm-search"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Checks whether or not the given search service name is available for use. Search service names must be globally unique since they are part of the service URI (https://.search.windows.net). + * + * @summary Checks whether or not the given search service name is available for use. Search service names must be globally unique since they are part of the service URI (https://.search.windows.net). + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCheckNameAvailability.json + */ +async function searchCheckNameAvailability() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const name = "mysearchservice"; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.services.checkNameAvailability(name); + console.log(result); +} + +async function main() { + searchCheckNameAvailability(); +} + +main().catch(console.error); diff --git a/sdk/search/arm-search/samples/v3-beta/typescript/src/servicesCreateOrUpdateSample.ts b/sdk/search/arm-search/samples/v3-beta/typescript/src/servicesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..18e9c3ed5b16 --- /dev/null +++ b/sdk/search/arm-search/samples/v3-beta/typescript/src/servicesCreateOrUpdateSample.ts @@ -0,0 +1,332 @@ +/* + * 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 { SearchService, SearchManagementClient } from "@azure/arm-search"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. + * + * @summary Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateService.json + */ +async function searchCreateOrUpdateService() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const service: SearchService = { + hostingMode: "default", + location: "westus", + partitionCount: 1, + replicaCount: 3, + sku: { name: "standard" }, + tags: { appName: "My e-commerce app" }, + }; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.services.beginCreateOrUpdateAndWait( + resourceGroupName, + searchServiceName, + service, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. + * + * @summary Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceAuthOptions.json + */ +async function searchCreateOrUpdateServiceAuthOptions() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const service: SearchService = { + authOptions: { + aadOrApiKey: { aadAuthFailureMode: "http401WithBearerChallenge" }, + }, + hostingMode: "default", + location: "westus", + partitionCount: 1, + replicaCount: 3, + sku: { name: "standard" }, + tags: { appName: "My e-commerce app" }, + }; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.services.beginCreateOrUpdateAndWait( + resourceGroupName, + searchServiceName, + service, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. + * + * @summary Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceDisableLocalAuth.json + */ +async function searchCreateOrUpdateServiceDisableLocalAuth() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const service: SearchService = { + disableLocalAuth: true, + hostingMode: "default", + location: "westus", + partitionCount: 1, + replicaCount: 3, + sku: { name: "standard" }, + tags: { appName: "My e-commerce app" }, + }; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.services.beginCreateOrUpdateAndWait( + resourceGroupName, + searchServiceName, + service, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. + * + * @summary Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceToAllowAccessFromPrivateEndpoints.json + */ +async function searchCreateOrUpdateServiceToAllowAccessFromPrivateEndpoints() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const service: SearchService = { + hostingMode: "default", + location: "westus", + partitionCount: 1, + publicNetworkAccess: "disabled", + replicaCount: 3, + sku: { name: "standard" }, + tags: { appName: "My e-commerce app" }, + }; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.services.beginCreateOrUpdateAndWait( + resourceGroupName, + searchServiceName, + service, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. + * + * @summary Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPs.json + */ +async function searchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPs() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const service: SearchService = { + hostingMode: "default", + location: "westus", + networkRuleSet: { + ipRules: [{ value: "123.4.5.6" }, { value: "123.4.6.0/18" }], + }, + partitionCount: 1, + replicaCount: 1, + sku: { name: "standard" }, + tags: { appName: "My e-commerce app" }, + }; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.services.beginCreateOrUpdateAndWait( + resourceGroupName, + searchServiceName, + service, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. + * + * @summary Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass.json + */ +async function searchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const service: SearchService = { + hostingMode: "default", + location: "westus", + networkRuleSet: { + bypass: "AzurePortal", + ipRules: [{ value: "123.4.5.6" }, { value: "123.4.6.0/18" }], + }, + partitionCount: 1, + replicaCount: 1, + sku: { name: "standard" }, + tags: { appName: "My e-commerce app" }, + }; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.services.beginCreateOrUpdateAndWait( + resourceGroupName, + searchServiceName, + service, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. + * + * @summary Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceWithCmkEnforcement.json + */ +async function searchCreateOrUpdateServiceWithCmkEnforcement() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const service: SearchService = { + encryptionWithCmk: { enforcement: "Enabled" }, + hostingMode: "default", + location: "westus", + partitionCount: 1, + replicaCount: 3, + sku: { name: "standard" }, + tags: { appName: "My e-commerce app" }, + }; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.services.beginCreateOrUpdateAndWait( + resourceGroupName, + searchServiceName, + service, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. + * + * @summary Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceWithDataExfiltration.json + */ +async function searchCreateOrUpdateServiceWithDataExfiltration() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const service: SearchService = { + disabledDataExfiltrationOptions: ["All"], + hostingMode: "default", + location: "westus", + partitionCount: 1, + replicaCount: 3, + sku: { name: "standard" }, + tags: { appName: "My e-commerce app" }, + }; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.services.beginCreateOrUpdateAndWait( + resourceGroupName, + searchServiceName, + service, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. + * + * @summary Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceWithIdentity.json + */ +async function searchCreateOrUpdateServiceWithIdentity() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const service: SearchService = { + hostingMode: "default", + identity: { + type: "SystemAssigned, UserAssigned", + userAssignedIdentities: { + "/subscriptions/00000000000000000000000000000000/resourcegroups/rg1/providers/MicrosoftManagedIdentity/userAssignedIdentities/userMi": + {}, + }, + }, + location: "westus", + partitionCount: 1, + replicaCount: 3, + sku: { name: "standard" }, + tags: { appName: "My e-commerce app" }, + }; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.services.beginCreateOrUpdateAndWait( + resourceGroupName, + searchServiceName, + service, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. + * + * @summary Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateWithSemanticSearch.json + */ +async function searchCreateOrUpdateWithSemanticSearch() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const service: SearchService = { + hostingMode: "default", + location: "westus", + partitionCount: 1, + replicaCount: 3, + semanticSearch: "free", + sku: { name: "standard" }, + tags: { appName: "My e-commerce app" }, + }; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.services.beginCreateOrUpdateAndWait( + resourceGroupName, + searchServiceName, + service, + ); + console.log(result); +} + +async function main() { + searchCreateOrUpdateService(); + searchCreateOrUpdateServiceAuthOptions(); + searchCreateOrUpdateServiceDisableLocalAuth(); + searchCreateOrUpdateServiceToAllowAccessFromPrivateEndpoints(); + searchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPs(); + searchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass(); + searchCreateOrUpdateServiceWithCmkEnforcement(); + searchCreateOrUpdateServiceWithDataExfiltration(); + searchCreateOrUpdateServiceWithIdentity(); + searchCreateOrUpdateWithSemanticSearch(); +} + +main().catch(console.error); diff --git a/sdk/search/arm-search/samples/v3-beta/typescript/src/servicesDeleteSample.ts b/sdk/search/arm-search/samples/v3-beta/typescript/src/servicesDeleteSample.ts new file mode 100644 index 000000000000..934ea94708ed --- /dev/null +++ b/sdk/search/arm-search/samples/v3-beta/typescript/src/servicesDeleteSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SearchManagementClient } from "@azure/arm-search"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Deletes a search service in the given resource group, along with its associated resources. + * + * @summary Deletes a search service in the given resource group, along with its associated resources. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchDeleteService.json + */ +async function searchDeleteService() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.services.delete( + resourceGroupName, + searchServiceName, + ); + console.log(result); +} + +async function main() { + searchDeleteService(); +} + +main().catch(console.error); diff --git a/sdk/search/arm-search/samples/v3-beta/typescript/src/servicesGetSample.ts b/sdk/search/arm-search/samples/v3-beta/typescript/src/servicesGetSample.ts new file mode 100644 index 000000000000..a6b102d2f393 --- /dev/null +++ b/sdk/search/arm-search/samples/v3-beta/typescript/src/servicesGetSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SearchManagementClient } from "@azure/arm-search"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets the search service with the given name in the given resource group. + * + * @summary Gets the search service with the given name in the given resource group. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchGetService.json + */ +async function searchGetService() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.services.get( + resourceGroupName, + searchServiceName, + ); + console.log(result); +} + +async function main() { + searchGetService(); +} + +main().catch(console.error); diff --git a/sdk/search/arm-search/samples/v3-beta/typescript/src/servicesListByResourceGroupSample.ts b/sdk/search/arm-search/samples/v3-beta/typescript/src/servicesListByResourceGroupSample.ts new file mode 100644 index 000000000000..d2d98157ef85 --- /dev/null +++ b/sdk/search/arm-search/samples/v3-beta/typescript/src/servicesListByResourceGroupSample.ts @@ -0,0 +1,41 @@ +/* + * 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 { SearchManagementClient } from "@azure/arm-search"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets a list of all Search services in the given resource group. + * + * @summary Gets a list of all Search services in the given resource group. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchListServicesByResourceGroup.json + */ +async function searchListServicesByResourceGroup() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.services.listByResourceGroup( + resourceGroupName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + searchListServicesByResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/search/arm-search/samples/v3-beta/typescript/src/servicesListBySubscriptionSample.ts b/sdk/search/arm-search/samples/v3-beta/typescript/src/servicesListBySubscriptionSample.ts new file mode 100644 index 000000000000..c20d277bd4e3 --- /dev/null +++ b/sdk/search/arm-search/samples/v3-beta/typescript/src/servicesListBySubscriptionSample.ts @@ -0,0 +1,38 @@ +/* + * 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 { SearchManagementClient } from "@azure/arm-search"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets a list of all Search services in the given subscription. + * + * @summary Gets a list of all Search services in the given subscription. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchListServicesBySubscription.json + */ +async function searchListServicesBySubscription() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.services.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + searchListServicesBySubscription(); +} + +main().catch(console.error); diff --git a/sdk/search/arm-search/samples/v3-beta/typescript/src/servicesUpdateSample.ts b/sdk/search/arm-search/samples/v3-beta/typescript/src/servicesUpdateSample.ts new file mode 100644 index 000000000000..04949fc7d969 --- /dev/null +++ b/sdk/search/arm-search/samples/v3-beta/typescript/src/servicesUpdateSample.ts @@ -0,0 +1,287 @@ +/* + * 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 { SearchServiceUpdate, SearchManagementClient } from "@azure/arm-search"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Updates an existing search service in the given resource group. + * + * @summary Updates an existing search service in the given resource group. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateService.json + */ +async function searchUpdateService() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const service: SearchServiceUpdate = { + replicaCount: 2, + tags: { appName: "My e-commerce app", newTag: "Adding a new tag" }, + }; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.services.update( + resourceGroupName, + searchServiceName, + service, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Updates an existing search service in the given resource group. + * + * @summary Updates an existing search service in the given resource group. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceAuthOptions.json + */ +async function searchUpdateServiceAuthOptions() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const service: SearchServiceUpdate = { + authOptions: { + aadOrApiKey: { aadAuthFailureMode: "http401WithBearerChallenge" }, + }, + replicaCount: 2, + tags: { appName: "My e-commerce app", newTag: "Adding a new tag" }, + }; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.services.update( + resourceGroupName, + searchServiceName, + service, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Updates an existing search service in the given resource group. + * + * @summary Updates an existing search service in the given resource group. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceDisableLocalAuth.json + */ +async function searchUpdateServiceDisableLocalAuth() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const service: SearchServiceUpdate = { + disableLocalAuth: true, + replicaCount: 2, + tags: { appName: "My e-commerce app", newTag: "Adding a new tag" }, + }; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.services.update( + resourceGroupName, + searchServiceName, + service, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Updates an existing search service in the given resource group. + * + * @summary Updates an existing search service in the given resource group. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceToAllowAccessFromPrivateEndpoints.json + */ +async function searchUpdateServiceToAllowAccessFromPrivateEndpoints() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const service: SearchServiceUpdate = { + partitionCount: 1, + publicNetworkAccess: "disabled", + replicaCount: 1, + }; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.services.update( + resourceGroupName, + searchServiceName, + service, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Updates an existing search service in the given resource group. + * + * @summary Updates an existing search service in the given resource group. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceToAllowAccessFromPublicCustomIPs.json + */ +async function searchUpdateServiceToAllowAccessFromPublicCustomIPs() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const service: SearchServiceUpdate = { + networkRuleSet: { + ipRules: [{ value: "123.4.5.6" }, { value: "123.4.6.0/18" }], + }, + partitionCount: 1, + publicNetworkAccess: "enabled", + replicaCount: 3, + }; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.services.update( + resourceGroupName, + searchServiceName, + service, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Updates an existing search service in the given resource group. + * + * @summary Updates an existing search service in the given resource group. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass.json + */ +async function searchUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const service: SearchServiceUpdate = { + networkRuleSet: { + bypass: "AzurePortal", + ipRules: [{ value: "123.4.5.6" }, { value: "123.4.6.0/18" }], + }, + partitionCount: 1, + publicNetworkAccess: "enabled", + replicaCount: 3, + }; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.services.update( + resourceGroupName, + searchServiceName, + service, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Updates an existing search service in the given resource group. + * + * @summary Updates an existing search service in the given resource group. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceToRemoveIdentity.json + */ +async function searchUpdateServiceToRemoveIdentity() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const service: SearchServiceUpdate = { + identity: { type: "None" }, + sku: { name: "standard" }, + }; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.services.update( + resourceGroupName, + searchServiceName, + service, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Updates an existing search service in the given resource group. + * + * @summary Updates an existing search service in the given resource group. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceWithCmkEnforcement.json + */ +async function searchUpdateServiceWithCmkEnforcement() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const service: SearchServiceUpdate = { + encryptionWithCmk: { enforcement: "Enabled" }, + replicaCount: 2, + tags: { appName: "My e-commerce app", newTag: "Adding a new tag" }, + }; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.services.update( + resourceGroupName, + searchServiceName, + service, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Updates an existing search service in the given resource group. + * + * @summary Updates an existing search service in the given resource group. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceWithDataExfiltration.json + */ +async function searchUpdateServiceWithDataExfiltration() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const service: SearchServiceUpdate = { + disabledDataExfiltrationOptions: ["All"], + replicaCount: 2, + tags: { appName: "My e-commerce app", newTag: "Adding a new tag" }, + }; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.services.update( + resourceGroupName, + searchServiceName, + service, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Updates an existing search service in the given resource group. + * + * @summary Updates an existing search service in the given resource group. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceWithSemanticSearch.json + */ +async function searchUpdateServiceWithSemanticSearch() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const service: SearchServiceUpdate = { + replicaCount: 2, + semanticSearch: "standard", + tags: { appName: "My e-commerce app", newTag: "Adding a new tag" }, + }; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.services.update( + resourceGroupName, + searchServiceName, + service, + ); + console.log(result); +} + +async function main() { + searchUpdateService(); + searchUpdateServiceAuthOptions(); + searchUpdateServiceDisableLocalAuth(); + searchUpdateServiceToAllowAccessFromPrivateEndpoints(); + searchUpdateServiceToAllowAccessFromPublicCustomIPs(); + searchUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass(); + searchUpdateServiceToRemoveIdentity(); + searchUpdateServiceWithCmkEnforcement(); + searchUpdateServiceWithDataExfiltration(); + searchUpdateServiceWithSemanticSearch(); +} + +main().catch(console.error); diff --git a/sdk/search/arm-search/samples/v3-beta/typescript/src/sharedPrivateLinkResourcesCreateOrUpdateSample.ts b/sdk/search/arm-search/samples/v3-beta/typescript/src/sharedPrivateLinkResourcesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..df6788d5903b --- /dev/null +++ b/sdk/search/arm-search/samples/v3-beta/typescript/src/sharedPrivateLinkResourcesCreateOrUpdateSample.ts @@ -0,0 +1,56 @@ +/* + * 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 { + SharedPrivateLinkResource, + SearchManagementClient, +} from "@azure/arm-search"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Initiates the creation or update of a shared private link resource managed by the search service in the given resource group. + * + * @summary Initiates the creation or update of a shared private link resource managed by the search service in the given resource group. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/CreateOrUpdateSharedPrivateLinkResource.json + */ +async function sharedPrivateLinkResourceCreateOrUpdate() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const sharedPrivateLinkResourceName = "testResource"; + const sharedPrivateLinkResource: SharedPrivateLinkResource = { + properties: { + groupId: "blob", + privateLinkResourceId: + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/storageAccountName", + requestMessage: "please approve", + resourceRegion: undefined, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = + await client.sharedPrivateLinkResources.beginCreateOrUpdateAndWait( + resourceGroupName, + searchServiceName, + sharedPrivateLinkResourceName, + sharedPrivateLinkResource, + ); + console.log(result); +} + +async function main() { + sharedPrivateLinkResourceCreateOrUpdate(); +} + +main().catch(console.error); diff --git a/sdk/search/arm-search/samples/v3-beta/typescript/src/sharedPrivateLinkResourcesDeleteSample.ts b/sdk/search/arm-search/samples/v3-beta/typescript/src/sharedPrivateLinkResourcesDeleteSample.ts new file mode 100644 index 000000000000..20699b031063 --- /dev/null +++ b/sdk/search/arm-search/samples/v3-beta/typescript/src/sharedPrivateLinkResourcesDeleteSample.ts @@ -0,0 +1,42 @@ +/* + * 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 { SearchManagementClient } from "@azure/arm-search"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Initiates the deletion of the shared private link resource from the search service. + * + * @summary Initiates the deletion of the shared private link resource from the search service. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/DeleteSharedPrivateLinkResource.json + */ +async function sharedPrivateLinkResourceDelete() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const sharedPrivateLinkResourceName = "testResource"; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.sharedPrivateLinkResources.beginDeleteAndWait( + resourceGroupName, + searchServiceName, + sharedPrivateLinkResourceName, + ); + console.log(result); +} + +async function main() { + sharedPrivateLinkResourceDelete(); +} + +main().catch(console.error); diff --git a/sdk/search/arm-search/samples/v3-beta/typescript/src/sharedPrivateLinkResourcesGetSample.ts b/sdk/search/arm-search/samples/v3-beta/typescript/src/sharedPrivateLinkResourcesGetSample.ts new file mode 100644 index 000000000000..6f0aa6e28212 --- /dev/null +++ b/sdk/search/arm-search/samples/v3-beta/typescript/src/sharedPrivateLinkResourcesGetSample.ts @@ -0,0 +1,42 @@ +/* + * 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 { SearchManagementClient } from "@azure/arm-search"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets the details of the shared private link resource managed by the search service in the given resource group. + * + * @summary Gets the details of the shared private link resource managed by the search service in the given resource group. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/GetSharedPrivateLinkResource.json + */ +async function sharedPrivateLinkResourceGet() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const sharedPrivateLinkResourceName = "testResource"; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.sharedPrivateLinkResources.get( + resourceGroupName, + searchServiceName, + sharedPrivateLinkResourceName, + ); + console.log(result); +} + +async function main() { + sharedPrivateLinkResourceGet(); +} + +main().catch(console.error); diff --git a/sdk/search/arm-search/samples/v3-beta/typescript/src/sharedPrivateLinkResourcesListByServiceSample.ts b/sdk/search/arm-search/samples/v3-beta/typescript/src/sharedPrivateLinkResourcesListByServiceSample.ts new file mode 100644 index 000000000000..2930e326088d --- /dev/null +++ b/sdk/search/arm-search/samples/v3-beta/typescript/src/sharedPrivateLinkResourcesListByServiceSample.ts @@ -0,0 +1,43 @@ +/* + * 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 { SearchManagementClient } from "@azure/arm-search"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets a list of all shared private link resources managed by the given service. + * + * @summary Gets a list of all shared private link resources managed by the given service. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/ListSharedPrivateLinkResourcesByService.json + */ +async function listSharedPrivateLinkResourcesByService() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1"; + const searchServiceName = "mysearchservice"; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.sharedPrivateLinkResources.listByService( + resourceGroupName, + searchServiceName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listSharedPrivateLinkResourcesByService(); +} + +main().catch(console.error); diff --git a/sdk/search/arm-search/samples/v3-beta/typescript/src/usageBySubscriptionSkuSample.ts b/sdk/search/arm-search/samples/v3-beta/typescript/src/usageBySubscriptionSkuSample.ts new file mode 100644 index 000000000000..3f781a83a983 --- /dev/null +++ b/sdk/search/arm-search/samples/v3-beta/typescript/src/usageBySubscriptionSkuSample.ts @@ -0,0 +1,37 @@ +/* + * 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 { SearchManagementClient } from "@azure/arm-search"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets the quota usage for a search sku in the given subscription. + * + * @summary Gets the quota usage for a search sku in the given subscription. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/GetQuotaUsage.json + */ +async function getQuotaUsage() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const location = "westus"; + const skuName = "free"; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const result = await client.usageBySubscriptionSku(location, skuName); + console.log(result); +} + +async function main() { + getQuotaUsage(); +} + +main().catch(console.error); diff --git a/sdk/search/arm-search/samples/v3-beta/typescript/src/usagesListBySubscriptionSample.ts b/sdk/search/arm-search/samples/v3-beta/typescript/src/usagesListBySubscriptionSample.ts new file mode 100644 index 000000000000..f58911eefd8a --- /dev/null +++ b/sdk/search/arm-search/samples/v3-beta/typescript/src/usagesListBySubscriptionSample.ts @@ -0,0 +1,39 @@ +/* + * 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 { SearchManagementClient } from "@azure/arm-search"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of all Azure AI Search quota usages across the subscription. + * + * @summary Get a list of all Azure AI Search quota usages across the subscription. + * x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/GetQuotaUsagesList.json + */ +async function getQuotaUsagesList() { + const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid"; + const location = "westus"; + const credential = new DefaultAzureCredential(); + const client = new SearchManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.usages.listBySubscription(location)) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + getQuotaUsagesList(); +} + +main().catch(console.error); diff --git a/sdk/search/arm-search/samples/v3-beta/typescript/tsconfig.json b/sdk/search/arm-search/samples/v3-beta/typescript/tsconfig.json new file mode 100644 index 000000000000..e26ce2a6d8f7 --- /dev/null +++ b/sdk/search/arm-search/samples/v3-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/search/arm-search/src/lroImpl.ts b/sdk/search/arm-search/src/lroImpl.ts index dd803cd5e28c..b27f5ac7209b 100644 --- a/sdk/search/arm-search/src/lroImpl.ts +++ b/sdk/search/arm-search/src/lroImpl.ts @@ -28,15 +28,15 @@ export function createLroSpec(inputs: { sendInitialRequest: () => sendOperationFn(args, spec), sendPollRequest: ( path: string, - options?: { abortSignal?: AbortSignalLike } + options?: { abortSignal?: AbortSignalLike }, ) => { const { requestBody, ...restSpec } = spec; return sendOperationFn(args, { ...restSpec, httpMethod: "GET", path, - abortSignal: options?.abortSignal + abortSignal: options?.abortSignal, }); - } + }, }; } diff --git a/sdk/search/arm-search/src/models/index.ts b/sdk/search/arm-search/src/models/index.ts index cd80f5fe1313..318cd6464f2b 100644 --- a/sdk/search/arm-search/src/models/index.ts +++ b/sdk/search/arm-search/src/models/index.ts @@ -8,10 +8,10 @@ import * as coreClient from "@azure/core-client"; -/** The result of the request to list REST API operations. It contains a list of operations and a URL to get the next set of results. */ +/** The result of the request to list REST API operations. It contains a list of operations and a URL to get the next set of results. */ export interface OperationListResult { /** - * The list of operations supported by the resource provider. + * The list of operations by Azure AI Search, some supported by the resource provider and others by data plane APIs. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly value?: Operation[]; @@ -34,6 +34,21 @@ export interface Operation { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly display?: OperationDisplay; + /** + * Describes if the specified operation is a data plane API operation. Operations where this value is not true are supported directly by the resource provider. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly isDataAction?: boolean; + /** + * Describes which originating entities are allowed to invoke this operation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly origin?: string; + /** + * Describes additional properties for this operation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly properties?: OperationProperties; } /** The object that describes the operation. */ @@ -60,10 +75,121 @@ export interface OperationDisplay { readonly description?: string; } +/** Describes additional properties for this operation. */ +export interface OperationProperties { + /** + * Specifications of the service for this operation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly serviceSpecification?: OperationServiceSpecification; +} + +/** Specifications of the service for this operation. */ +export interface OperationServiceSpecification { + /** + * Specifications of metrics for this operation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly metricSpecifications?: OperationMetricsSpecification[]; + /** + * Specifications of logs for this operation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly logSpecifications?: OperationLogsSpecification[]; +} + +/** Specifications of one type of metric for this operation. */ +export interface OperationMetricsSpecification { + /** + * The name of the metric specification. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * The display name of the metric specification. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly displayName?: string; + /** + * The display description of the metric specification. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly displayDescription?: string; + /** + * The unit for the metric specification. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly unit?: string; + /** + * The type of aggregation for the metric specification. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly aggregationType?: string; + /** + * Dimensions for the metric specification. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly dimensions?: OperationMetricDimension[]; + /** + * Availabilities for the metric specification. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly availabilities?: OperationAvailability[]; +} + +/** Describes a particular dimension for the metric specification. */ +export interface OperationMetricDimension { + /** + * The name of the dimension. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * The display name of the dimension. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly displayName?: string; +} + +/** Describes a particular availability for the metric specification. */ +export interface OperationAvailability { + /** + * The time grain for the dimension. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly timeGrain?: string; + /** + * The blob duration for the dimension. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly blobDuration?: string; +} + +/** Specifications of one type of log for this operation. */ +export interface OperationLogsSpecification { + /** + * The name of the log specification. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * The display name of the log specification. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly displayName?: string; + /** + * The blob duration for the log specification. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly blobDuration?: string; +} + /** Contains information about an API error. */ export interface CloudError { /** Describes a particular API error with an error code and a message. */ error?: CloudErrorBody; + /** A brief description of the error that hints at what went wrong (for details/debugging information refer to the 'error.message' property). */ + message?: string; } /** Describes a particular API error with an error code and a message. */ @@ -78,7 +204,7 @@ export interface CloudErrorBody { details?: CloudErrorBody[]; } -/** Response containing the primary and secondary admin API keys for a given Azure Cognitive Search service. */ +/** Response containing the primary and secondary admin API keys for a given Azure AI Search service. */ export interface AdminKeyResult { /** * The primary admin API key of the search service. @@ -92,10 +218,10 @@ export interface AdminKeyResult { readonly secondaryKey?: string; } -/** Describes an API key for a given Azure Cognitive Search service that has permissions for query operations only. */ +/** Describes an API key for a given Azure AI Search service that conveys read-only permissions on the docs collection of an index. */ export interface QueryKey { /** - * The name of the query API key; may be empty. + * The name of the query API key. Query names are optional, but assigning a name can help you remember how it's used. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly name?: string; @@ -106,10 +232,10 @@ export interface QueryKey { readonly key?: string; } -/** Response containing the query API keys for a given Azure Cognitive Search service. */ +/** Response containing the query API keys for a given Azure AI Search service. */ export interface ListQueryKeysResult { /** - * The query keys for the Azure Cognitive Search service. + * The query keys for the Azure AI Search service. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly value?: QueryKey[]; @@ -120,64 +246,66 @@ export interface ListQueryKeysResult { readonly nextLink?: string; } -/** Network specific rules that determine how the Azure Cognitive Search service may be reached. */ +/** Network specific rules that determine how the Azure AI Search service may be reached. */ export interface NetworkRuleSet { /** A list of IP restriction rules that defines the inbound network(s) with allowing access to the search service endpoint. At the meantime, all other public IP networks are blocked by the firewall. These restriction rules are applied only when the 'publicNetworkAccess' of the search service is 'enabled'; otherwise, traffic over public interface is not allowed even with any public IP rules, and private endpoint connections would be the exclusive access method. */ ipRules?: IpRule[]; + /** Possible origins of inbound traffic that can bypass the rules defined in the 'ipRules' section. */ + bypass?: SearchBypass; } -/** The IP restriction rule of the Azure Cognitive Search service. */ +/** The IP restriction rule of the Azure AI Search service. */ export interface IpRule { /** Value corresponding to a single IPv4 address (eg., 123.1.2.3) or an IP range in CIDR format (eg., 123.1.2.3/24) to be allowed. */ value?: string; } -/** Describes a policy that determines how resources within the search service are to be encrypted with Customer Managed Keys. */ +/** Describes a policy that determines how resources within the search service are to be encrypted with customer managed keys. */ export interface EncryptionWithCmk { - /** Describes how a search service should enforce having one or more non customer encrypted resources. */ + /** Describes how a search service should enforce compliance if it finds objects that aren't encrypted with the customer-managed key. */ enforcement?: SearchEncryptionWithCmk; /** - * Describes whether the search service is compliant or not with respect to having non customer encrypted resources. If a service has more than one non customer encrypted resource and 'Enforcement' is 'enabled' then the service will be marked as 'nonCompliant'. + * Returns the status of search service compliance with respect to non-CMK-encrypted objects. If a service has more than one unencrypted object, and enforcement is enabled, the service is marked as noncompliant. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly encryptionComplianceStatus?: SearchEncryptionComplianceStatus; } -/** Defines the options for how the data plane API of a Search service authenticates requests. This cannot be set if 'disableLocalAuth' is set to true. */ +/** Defines the options for how the search service authenticates a data plane request. This cannot be set if 'disableLocalAuth' is set to true. */ export interface DataPlaneAuthOptions { - /** Indicates that only the API key needs to be used for authentication. */ + /** Indicates that only the API key can be used for authentication. */ apiKeyOnly?: Record; - /** Indicates that either the API key or an access token from Azure Active Directory can be used for authentication. */ + /** Indicates that either the API key or an access token from a Microsoft Entra ID tenant can be used for authentication. */ aadOrApiKey?: DataPlaneAadOrApiKeyAuthOption; } -/** Indicates that either the API key or an access token from Azure Active Directory can be used for authentication. */ +/** Indicates that either the API key or an access token from a Microsoft Entra ID tenant can be used for authentication. */ export interface DataPlaneAadOrApiKeyAuthOption { - /** Describes what response the data plane API of a Search service would send for requests that failed authentication. */ + /** Describes what response the data plane API of a search service would send for requests that failed authentication. */ aadAuthFailureMode?: AadAuthFailureMode; } -/** Describes the properties of an existing Private Endpoint connection to the Azure Cognitive Search service. */ +/** Describes the properties of an existing private endpoint connection to the search service. */ export interface PrivateEndpointConnectionProperties { /** The private endpoint resource from Microsoft.Network provider. */ privateEndpoint?: PrivateEndpointConnectionPropertiesPrivateEndpoint; - /** Describes the current state of an existing Private Link Service connection to the Azure Private Endpoint. */ + /** Describes the current state of an existing Azure Private Link service connection to the private endpoint. */ privateLinkServiceConnectionState?: PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState; - /** The group id from the provider of resource the private link service connection is for. */ + /** The group ID of the Azure resource for which the private link service is for. */ groupId?: string; - /** The provisioning state of the private link service connection. Can be Updating, Deleting, Failed, Succeeded, or Incomplete */ + /** The provisioning state of the private link service connection. Valid values are Updating, Deleting, Failed, Succeeded, Incomplete, or Canceled. */ provisioningState?: PrivateLinkServiceConnectionProvisioningState; } /** The private endpoint resource from Microsoft.Network provider. */ export interface PrivateEndpointConnectionPropertiesPrivateEndpoint { - /** The resource id of the private endpoint resource from Microsoft.Network provider. */ + /** The resource ID of the private endpoint resource from Microsoft.Network provider. */ id?: string; } -/** Describes the current state of an existing Private Link Service connection to the Azure Private Endpoint. */ +/** Describes the current state of an existing Azure Private Link service connection to the private endpoint. */ export interface PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState { - /** Status of the the private link service connection. Can be Pending, Approved, Rejected, or Disconnected. */ + /** Status of the the private link service connection. Valid values are Pending, Approved, Rejected, or Disconnected. */ status?: PrivateLinkServiceConnectionStatus; /** The description for the private link service connection state. */ description?: string; @@ -204,29 +332,29 @@ export interface Resource { readonly type?: string; } -/** Describes the properties of an existing Shared Private Link Resource managed by the Azure Cognitive Search service. */ +/** Describes the properties of an existing shared private link resource managed by the Azure AI Search service. */ export interface SharedPrivateLinkResourceProperties { - /** The resource id of the resource the shared private link resource is for. */ + /** The resource ID of the resource the shared private link resource is for. */ privateLinkResourceId?: string; - /** The group id from the provider of resource the shared private link resource is for. */ + /** The group ID from the provider of resource the shared private link resource is for. */ groupId?: string; - /** The request message for requesting approval of the shared private link resource. */ + /** The message for requesting approval of the shared private link resource. */ requestMessage?: string; - /** Optional. Can be used to specify the Azure Resource Manager location of the resource to which a shared private link is to be created. This is only required for those resources whose DNS configuration are regional (such as Azure Kubernetes Service). */ + /** Optional. Can be used to specify the Azure Resource Manager location of the resource for which a shared private link is being created. This is only required for those resources whose DNS configuration are regional (such as Azure Kubernetes Service). */ resourceRegion?: string; - /** Status of the shared private link resource. Can be Pending, Approved, Rejected or Disconnected. */ + /** Status of the shared private link resource. Valid values are Pending, Approved, Rejected or Disconnected. */ status?: SharedPrivateLinkResourceStatus; - /** The provisioning state of the shared private link resource. Can be Updating, Deleting, Failed, Succeeded or Incomplete. */ + /** The provisioning state of the shared private link resource. Valid values are Updating, Deleting, Failed, Succeeded or Incomplete. */ provisioningState?: SharedPrivateLinkResourceProvisioningState; } -/** Defines the SKU of an Azure Cognitive Search Service, which determines price tier and capacity limits. */ +/** Defines the SKU of a search service, which determines billing rate and capacity limits. */ export interface Sku { /** The SKU of the search service. Valid values include: 'free': Shared service. 'basic': Dedicated service with up to 3 replicas. 'standard': Dedicated service with up to 12 partitions and 12 replicas. 'standard2': Similar to standard, but with more capacity per search unit. 'standard3': The largest Standard offering with up to 12 partitions and 12 replicas (or up to 3 partitions with more indexes if you also set the hostingMode property to 'highDensity'). 'storage_optimized_l1': Supports 1TB per partition, up to 12 partitions. 'storage_optimized_l2': Supports 2TB per partition, up to 12 partitions.' */ name?: SkuName; } -/** Identity for the resource. */ +/** Details about the search service identity. A null value indicates that the search service has no identity assigned. */ export interface Identity { /** * The principal ID of the system-assigned identity of the search service. @@ -238,14 +366,32 @@ export interface Identity { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly tenantId?: string; - /** The identity type. */ + /** The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' includes both an identity created by the system and a set of user assigned identities. The type 'None' will remove all identities from the service. */ type: IdentityType; + /** The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource IDs in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. */ + userAssignedIdentities?: { + [propertyName: string]: UserAssignedManagedIdentity; + }; +} + +/** The details of the user assigned managed identity assigned to the search service. */ +export interface UserAssignedManagedIdentity { + /** + * The principal ID of user assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly principalId?: string; + /** + * The client ID of user assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly clientId?: string; } -/** Response containing a list of Azure Cognitive Search services. */ +/** Response containing a list of Azure AI Search services. */ export interface SearchServiceListResult { /** - * The list of Search services. + * The list of search services. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly value?: SearchService[]; @@ -265,7 +411,7 @@ export interface PrivateLinkResourcesResult { readonly value?: PrivateLinkResource[]; } -/** Describes the properties of a supported private link resource for the Azure Cognitive Search service. For a given API version, this represents the 'supported' groupIds when creating a shared private link resource. */ +/** Describes the properties of a supported private link resource for the Azure AI Search service. For a given API version, this represents the 'supported' groupIds when creating a shared private link resource. */ export interface PrivateLinkResourceProperties { /** * The group ID of the private link resource. @@ -283,49 +429,49 @@ export interface PrivateLinkResourceProperties { */ readonly requiredZoneNames?: string[]; /** - * The list of resources that are onboarded to private link service, that are supported by Azure Cognitive Search. + * The list of resources that are onboarded to private link service, that are supported by Azure AI Search. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly shareablePrivateLinkResourceTypes?: ShareablePrivateLinkResourceType[]; } -/** Describes an resource type that has been onboarded to private link service, supported by Azure Cognitive Search. */ +/** Describes an resource type that has been onboarded to private link service, supported by Azure AI Search. */ export interface ShareablePrivateLinkResourceType { /** - * The name of the resource type that has been onboarded to private link service, supported by Azure Cognitive Search. + * The name of the resource type that has been onboarded to private link service, supported by Azure AI Search. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly name?: string; /** - * Describes the properties of a resource type that has been onboarded to private link service, supported by Azure Cognitive Search. + * Describes the properties of a resource type that has been onboarded to private link service, supported by Azure AI Search. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly properties?: ShareablePrivateLinkResourceProperties; } -/** Describes the properties of a resource type that has been onboarded to private link service, supported by Azure Cognitive Search. */ +/** Describes the properties of a resource type that has been onboarded to private link service, supported by Azure AI Search. */ export interface ShareablePrivateLinkResourceProperties { /** - * The resource provider type for the resource that has been onboarded to private link service, supported by Azure Cognitive Search. + * The resource provider type for the resource that has been onboarded to private link service, supported by Azure AI Search. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly type?: string; /** - * The resource provider group id for the resource that has been onboarded to private link service, supported by Azure Cognitive Search. + * The resource provider group id for the resource that has been onboarded to private link service, supported by Azure AI Search. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly groupId?: string; /** - * The description of the resource type that has been onboarded to private link service, supported by Azure Cognitive Search. + * The description of the resource type that has been onboarded to private link service, supported by Azure AI Search. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly description?: string; } -/** Response containing a list of Private Endpoint connections. */ +/** Response containing a list of private endpoint connections. */ export interface PrivateEndpointConnectionListResult { /** - * The list of Private Endpoint connections. + * The list of private endpoint connections. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly value?: PrivateEndpointConnection[]; @@ -336,10 +482,10 @@ export interface PrivateEndpointConnectionListResult { readonly nextLink?: string; } -/** Response containing a list of Shared Private Link Resources. */ +/** Response containing a list of shared private link resources. */ export interface SharedPrivateLinkResourceListResult { /** - * The list of Shared Private Link Resources. + * The list of shared private link resources. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly value?: SharedPrivateLinkResource[]; @@ -374,10 +520,10 @@ export interface CheckNameAvailabilityOutput { readonly message?: string; } -/** Response containing the quota usage information for all the supported skus of Azure Cognitive Search service. */ +/** Response containing the quota usage information for all the supported SKUs of Azure AI Search. */ export interface QuotaUsagesListResult { /** - * The quota usages for the SKUs supported by Azure Cognitive Search. + * The quota usages for the SKUs supported by Azure AI Search. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly value?: QuotaUsageResult[]; @@ -388,46 +534,119 @@ export interface QuotaUsagesListResult { readonly nextLink?: string; } -/** Describes the quota usage for a particular sku supported by Azure Cognitive Search. */ +/** Describes the quota usage for a particular SKU. */ export interface QuotaUsageResult { - /** The resource id of the quota usage sku endpoint for Microsoft.Search provider. */ + /** The resource ID of the quota usage SKU endpoint for Microsoft.Search provider. */ id?: string; - /** The unit of measurement for the search sku. */ + /** The unit of measurement for the search SKU. */ unit?: string; - /** The currently used up value for the particular search sku. */ + /** The currently used up value for the particular search SKU. */ currentValue?: number; - /** The quota limit for the particular search sku. */ + /** The quota limit for the particular search SKU. */ limit?: number; /** - * The name of the sku supported by Azure Cognitive Search. + * The name of the SKU supported by Azure AI Search. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly name?: QuotaUsageResultName; } -/** The name of the sku supported by Azure Cognitive Search. */ +/** The name of the SKU supported by Azure AI Search. */ export interface QuotaUsageResultName { - /** The sku name supported by Azure Cognitive Search. */ + /** The SKU name supported by Azure AI Search. */ value?: string; - /** The localized string value for the sku supported by Azure Cognitive Search. */ + /** The localized string value for the SKU name. */ localizedValue?: string; } -/** The details of a long running asynchronous shared private link resource operation */ +/** A list of network security perimeter configurations for a server. */ +export interface NetworkSecurityPerimeterConfigurationListResult { + /** + * Array of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: NetworkSecurityPerimeterConfiguration[]; + /** + * Link to retrieve next page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** The perimeter for a network security perimeter configuration. */ +export interface NSPConfigPerimeter { + id?: string; + perimeterGuid?: string; + location?: string; +} + +/** The resource association for the network security perimeter. */ +export interface NSPConfigAssociation { + name?: string; + accessMode?: string; +} + +/** The profile for a network security perimeter configuration. */ +export interface NSPConfigProfile { + name?: string; + accessRulesVersion?: string; + accessRules?: NSPConfigAccessRule[]; +} + +/** An access rule for a network security perimeter configuration. */ +export interface NSPConfigAccessRule { + name?: string; + /** The properties for the access rules in a network security perimeter configuration. */ + properties?: NSPConfigAccessRuleProperties; +} + +/** The properties for the access rules in a network security perimeter configuration. */ +export interface NSPConfigAccessRuleProperties { + direction?: string; + addressPrefixes?: string[]; + fullyQualifiedDomainNames?: string[]; + subscriptions?: string[]; + networkSecurityPerimeters?: NSPConfigNetworkSecurityPerimeterRule[]; +} + +/** The network security perimeter properties present in a configuration rule. */ +export interface NSPConfigNetworkSecurityPerimeterRule { + id?: string; + perimeterGuid?: string; + location?: string; +} + +/** An object to describe any issues with provisioning network security perimeters to a search service. */ +export interface NSPProvisioningIssue { + name?: string; + /** The properties to describe any issues with provisioning network security perimeters to a search service. */ + properties?: NSPProvisioningIssueProperties; +} + +/** The properties to describe any issues with provisioning network security perimeters to a search service. */ +export interface NSPProvisioningIssueProperties { + issueType?: string; + severity?: string; + description?: string; + suggestedResourceIds?: string[]; + suggestedAccessRules?: string[]; +} + +/** The details of a long running asynchronous shared private link resource operation. */ export interface AsyncOperationResult { /** The current status of the long running asynchronous shared private link resource operation. */ status?: SharedPrivateLinkResourceAsyncOperationResult; } -/** Describes an existing Private Endpoint connection to the Azure Cognitive Search service. */ +/** Describes an existing private endpoint connection to the Azure AI Search service. */ export interface PrivateEndpointConnection extends Resource { - /** Describes the properties of an existing Private Endpoint connection to the Azure Cognitive Search service. */ + /** Describes the properties of an existing private endpoint connection to the Azure AI Search service. */ properties?: PrivateEndpointConnectionProperties; } -/** Describes a Shared Private Link Resource managed by the Azure Cognitive Search service. */ +/** Describes a shared private link resource managed by the Azure AI Search service. */ export interface SharedPrivateLinkResource extends Resource { - /** Describes the properties of a Shared Private Link Resource managed by the Azure Cognitive Search service. */ + /** Describes the properties of a shared private link resource managed by the Azure AI Search service. */ properties?: SharedPrivateLinkResourceProperties; } @@ -439,15 +658,15 @@ export interface TrackedResource extends Resource { location: string; } -/** The parameters used to update an Azure Cognitive Search service. */ +/** The parameters used to update an Azure AI Search service. */ export interface SearchServiceUpdate extends Resource { - /** The SKU of the Search Service, which determines price tier and capacity limits. This property is required when creating a new Search Service. */ + /** The SKU of the search service, which determines price tier and capacity limits. This property is required when creating a new search service. */ sku?: Sku; - /** The geographic location of the resource. This must be one of the supported and registered Azure Geo Regions (for example, West US, East US, Southeast Asia, and so forth). This property is required when creating a new resource. */ + /** The geographic location of the resource. This must be one of the supported and registered Azure geo regions (for example, West US, East US, Southeast Asia, and so forth). This property is required when creating a new resource. */ location?: string; /** Tags to help categorize the resource in the Azure portal. */ tags?: { [propertyName: string]: string }; - /** The identity of the resource. */ + /** Details about the search service identity. A null value indicates that the search service has no identity assigned. */ identity?: Identity; /** The number of replicas in the search service. If specified, it must be a value between 1 and 12 inclusive for standard SKUs or between 1 and 3 inclusive for basic SKU. */ replicaCount?: number; @@ -458,7 +677,7 @@ export interface SearchServiceUpdate extends Resource { /** This value can be set to 'enabled' to avoid breaking changes on existing customer resources and templates. If set to 'disabled', traffic over public interface is not allowed, and private endpoint connections would be the exclusive access method. */ publicNetworkAccess?: PublicNetworkAccess; /** - * The status of the search service. Possible values include: 'running': The search service is running and no provisioning operations are underway. 'provisioning': The search service is being provisioned or scaled up or down. 'deleting': The search service is being deleted. 'degraded': The search service is degraded. This can occur when the underlying search units are not healthy. The search service is most likely operational, but performance might be slow and some requests might be dropped. 'disabled': The search service is disabled. In this state, the service will reject all API requests. 'error': The search service is in an error state. If your service is in the degraded, disabled, or error states, it means the Azure Cognitive Search team is actively investigating the underlying issue. Dedicated services in these states are still chargeable based on the number of search units provisioned. + * The status of the search service. Possible values include: 'running': The search service is running and no provisioning operations are underway. 'provisioning': The search service is being provisioned or scaled up or down. 'deleting': The search service is being deleted. 'degraded': The search service is degraded. This can occur when the underlying search units are not healthy. The search service is most likely operational, but performance might be slow and some requests might be dropped. 'disabled': The search service is disabled. In this state, the service will reject all API requests. 'error': The search service is in an error state. 'stopped': The search service is in a subscription that's disabled. If your service is in the degraded, disabled, or error states, it means the Azure AI Search team is actively investigating the underlying issue. Dedicated services in these states are still chargeable based on the number of search units provisioned. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly status?: SearchServiceStatus; @@ -472,40 +691,50 @@ export interface SearchServiceUpdate extends Resource { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: ProvisioningState; - /** Network specific rules that determine how the Azure Cognitive Search service may be reached. */ + /** Network specific rules that determine how the Azure AI Search service may be reached. */ networkRuleSet?: NetworkRuleSet; + /** A list of data exfiltration scenarios that are explicitly disallowed for the search service. Currently, the only supported value is 'All' to disable all possible data export scenarios with more fine grained controls planned for the future. */ + disabledDataExfiltrationOptions?: SearchDisabledDataExfiltrationOption[]; /** Specifies any policy regarding encryption of resources (such as indexes) using customer manager keys within a search service. */ encryptionWithCmk?: EncryptionWithCmk; /** When set to true, calls to the search service will not be permitted to utilize API keys for authentication. This cannot be set to true if 'dataPlaneAuthOptions' are defined. */ disableLocalAuth?: boolean; /** Defines the options for how the data plane API of a search service authenticates requests. This cannot be set if 'disableLocalAuth' is set to true. */ authOptions?: DataPlaneAuthOptions; + /** Sets options that control the availability of semantic search. This configuration is only possible for certain Azure AI Search SKUs in certain locations. */ + semanticSearch?: SearchSemanticSearch; /** - * The list of private endpoint connections to the Azure Cognitive Search service. + * The list of private endpoint connections to the Azure AI Search service. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly privateEndpointConnections?: PrivateEndpointConnection[]; - /** Sets options that control the availability of semantic search. This configuration is only possible for certain Azure Cognitive Search SKUs in certain locations. */ - semanticSearch?: SearchSemanticSearch; /** - * The list of shared private link resources managed by the Azure Cognitive Search service. + * The list of shared private link resources managed by the Azure AI Search service. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly sharedPrivateLinkResources?: SharedPrivateLinkResource[]; + /** + * A system generated property representing the service's etag that can be for optimistic concurrency control during updates. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly eTag?: string; } -/** Describes a supported private link resource for the Azure Cognitive Search service. */ +/** Describes a supported private link resource for the Azure AI Search service. */ export interface PrivateLinkResource extends Resource { /** - * Describes the properties of a supported private link resource for the Azure Cognitive Search service. + * Describes the properties of a supported private link resource for the Azure AI Search service. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly properties?: PrivateLinkResourceProperties; } -/** Describes an Azure Cognitive Search service and its current state. */ +/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ +export interface ProxyResource extends Resource {} + +/** Describes an Azure AI Search service and its current state. */ export interface SearchService extends TrackedResource { - /** The SKU of the Search Service, which determines price tier and capacity limits. This property is required when creating a new Search Service. */ + /** The SKU of the search service, which determines price tier and capacity limits. This property is required when creating a new search service. */ sku?: Sku; /** The identity of the resource. */ identity?: Identity; @@ -518,7 +747,7 @@ export interface SearchService extends TrackedResource { /** This value can be set to 'enabled' to avoid breaking changes on existing customer resources and templates. If set to 'disabled', traffic over public interface is not allowed, and private endpoint connections would be the exclusive access method. */ publicNetworkAccess?: PublicNetworkAccess; /** - * The status of the search service. Possible values include: 'running': The search service is running and no provisioning operations are underway. 'provisioning': The search service is being provisioned or scaled up or down. 'deleting': The search service is being deleted. 'degraded': The search service is degraded. This can occur when the underlying search units are not healthy. The search service is most likely operational, but performance might be slow and some requests might be dropped. 'disabled': The search service is disabled. In this state, the service will reject all API requests. 'error': The search service is in an error state. If your service is in the degraded, disabled, or error states, it means the Azure Cognitive Search team is actively investigating the underlying issue. Dedicated services in these states are still chargeable based on the number of search units provisioned. + * The status of the search service. Possible values include: 'running': The search service is running and no provisioning operations are underway. 'provisioning': The search service is being provisioned or scaled up or down. 'deleting': The search service is being deleted. 'degraded': The search service is degraded. This can occur when the underlying search units are not healthy. The search service is most likely operational, but performance might be slow and some requests might be dropped. 'disabled': The search service is disabled. In this state, the service will reject all API requests. 'error': The search service is in an error state. 'stopped': The search service is in a subscription that's disabled. If your service is in the degraded, disabled, or error states, it means the Azure AI Search team is actively investigating the underlying issue. Dedicated services in these states are still chargeable based on the number of search units provisioned. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly status?: SearchServiceStatus; @@ -532,26 +761,51 @@ export interface SearchService extends TrackedResource { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: ProvisioningState; - /** Network specific rules that determine how the Azure Cognitive Search service may be reached. */ + /** Network specific rules that determine how the Azure AI Search service may be reached. */ networkRuleSet?: NetworkRuleSet; + /** A list of data exfiltration scenarios that are explicitly disallowed for the search service. Currently, the only supported value is 'All' to disable all possible data export scenarios with more fine grained controls planned for the future. */ + disabledDataExfiltrationOptions?: SearchDisabledDataExfiltrationOption[]; /** Specifies any policy regarding encryption of resources (such as indexes) using customer manager keys within a search service. */ encryptionWithCmk?: EncryptionWithCmk; /** When set to true, calls to the search service will not be permitted to utilize API keys for authentication. This cannot be set to true if 'dataPlaneAuthOptions' are defined. */ disableLocalAuth?: boolean; /** Defines the options for how the data plane API of a search service authenticates requests. This cannot be set if 'disableLocalAuth' is set to true. */ authOptions?: DataPlaneAuthOptions; + /** Sets options that control the availability of semantic search. This configuration is only possible for certain Azure AI Search SKUs in certain locations. */ + semanticSearch?: SearchSemanticSearch; /** - * The list of private endpoint connections to the Azure Cognitive Search service. + * The list of private endpoint connections to the Azure AI Search service. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly privateEndpointConnections?: PrivateEndpointConnection[]; - /** Sets options that control the availability of semantic search. This configuration is only possible for certain Azure Cognitive Search SKUs in certain locations. */ - semanticSearch?: SearchSemanticSearch; /** - * The list of shared private link resources managed by the Azure Cognitive Search service. + * The list of shared private link resources managed by the Azure AI Search service. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly sharedPrivateLinkResources?: SharedPrivateLinkResource[]; + /** + * A system generated property representing the service's etag that can be for optimistic concurrency control during updates. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly eTag?: string; +} + +/** Network security perimeter configuration for a server. */ +export interface NetworkSecurityPerimeterConfiguration extends ProxyResource { + /** NOTE: This property will not be serialized. It can only be populated by the server. */ + readonly provisioningState?: string; + /** The perimeter for a network security perimeter configuration. */ + networkSecurityPerimeter?: NSPConfigPerimeter; + /** The resource association for the network security perimeter. */ + resourceAssociation?: NSPConfigAssociation; + /** The profile for a network security perimeter configuration. */ + profile?: NSPConfigProfile; + provisioningIssues?: NSPProvisioningIssue[]; +} + +/** Defines headers for NetworkSecurityPerimeterConfigurations_reconcile operation. */ +export interface NetworkSecurityPerimeterConfigurationsReconcileHeaders { + location?: string; } /** Parameter group */ @@ -560,6 +814,78 @@ export interface SearchManagementRequestOptions { clientRequestId?: string; } +/** Known values of {@link PublicNetworkAccess} that the service accepts. */ +export enum KnownPublicNetworkAccess { + /** The search service is accessible from traffic originating from the public internet. */ + Enabled = "enabled", + /** The search service is not accessible from traffic originating from the public internet. Access is only permitted over approved private endpoint connections. */ + Disabled = "disabled", +} + +/** + * Defines values for PublicNetworkAccess. \ + * {@link KnownPublicNetworkAccess} can be used interchangeably with PublicNetworkAccess, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **enabled**: The search service is accessible from traffic originating from the public internet. \ + * **disabled**: The search service is not accessible from traffic originating from the public internet. Access is only permitted over approved private endpoint connections. + */ +export type PublicNetworkAccess = string; + +/** Known values of {@link SearchBypass} that the service accepts. */ +export enum KnownSearchBypass { + /** Indicates that no origin can bypass the rules defined in the 'ipRules' section. This is the default. */ + None = "None", + /** Indicates that requests originating from the Azure portal can bypass the rules defined in the 'ipRules' section. */ + AzurePortal = "AzurePortal", +} + +/** + * Defines values for SearchBypass. \ + * {@link KnownSearchBypass} can be used interchangeably with SearchBypass, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None**: Indicates that no origin can bypass the rules defined in the 'ipRules' section. This is the default. \ + * **AzurePortal**: Indicates that requests originating from the Azure portal can bypass the rules defined in the 'ipRules' section. + */ +export type SearchBypass = string; + +/** Known values of {@link SearchDisabledDataExfiltrationOption} that the service accepts. */ +export enum KnownSearchDisabledDataExfiltrationOption { + /** Indicates that all data exfiltration scenarios are disabled. */ + All = "All", +} + +/** + * Defines values for SearchDisabledDataExfiltrationOption. \ + * {@link KnownSearchDisabledDataExfiltrationOption} can be used interchangeably with SearchDisabledDataExfiltrationOption, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **All**: Indicates that all data exfiltration scenarios are disabled. + */ +export type SearchDisabledDataExfiltrationOption = string; + +/** Known values of {@link SearchSemanticSearch} that the service accepts. */ +export enum KnownSearchSemanticSearch { + /** Indicates that semantic reranker is disabled for the search service. This is the default. */ + Disabled = "disabled", + /** Enables semantic reranker on a search service and indicates that it is to be used within the limits of the free plan. The free plan would cap the volume of semantic ranking requests and is offered at no extra charge. This is the default for newly provisioned search services. */ + Free = "free", + /** Enables semantic reranker on a search service as a billable feature, with higher throughput and volume of semantically reranked queries. */ + Standard = "standard", +} + +/** + * Defines values for SearchSemanticSearch. \ + * {@link KnownSearchSemanticSearch} can be used interchangeably with SearchSemanticSearch, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **disabled**: Indicates that semantic reranker is disabled for the search service. This is the default. \ + * **free**: Enables semantic reranker on a search service and indicates that it is to be used within the limits of the free plan. The free plan would cap the volume of semantic ranking requests and is offered at no extra charge. This is the default for newly provisioned search services. \ + * **standard**: Enables semantic reranker on a search service as a billable feature, with higher throughput and volume of semantically reranked queries. + */ +export type SearchSemanticSearch = string; + /** Known values of {@link PrivateLinkServiceConnectionProvisioningState} that the service accepts. */ export enum KnownPrivateLinkServiceConnectionProvisioningState { /** The private link service connection is in the process of being created along with other resources for it to be fully functional. */ @@ -572,8 +898,8 @@ export enum KnownPrivateLinkServiceConnectionProvisioningState { Succeeded = "Succeeded", /** Provisioning request for the private link service connection resource has been accepted but the process of creation has not commenced yet. */ Incomplete = "Incomplete", - /** Provisioning request for the private link service connection resource has been canceled */ - Canceled = "Canceled" + /** Provisioning request for the private link service connection resource has been canceled. */ + Canceled = "Canceled", } /** @@ -586,37 +912,124 @@ export enum KnownPrivateLinkServiceConnectionProvisioningState { * **Failed**: The private link service connection has failed to be provisioned or deleted. \ * **Succeeded**: The private link service connection has finished provisioning and is ready for approval. \ * **Incomplete**: Provisioning request for the private link service connection resource has been accepted but the process of creation has not commenced yet. \ - * **Canceled**: Provisioning request for the private link service connection resource has been canceled + * **Canceled**: Provisioning request for the private link service connection resource has been canceled. */ export type PrivateLinkServiceConnectionProvisioningState = string; -/** Known values of {@link SearchSemanticSearch} that the service accepts. */ -export enum KnownSearchSemanticSearch { - /** Indicates that semantic search is disabled for the search service. */ - Disabled = "disabled", - /** Enables semantic search on a search service and indicates that it is to be used within the limits of the free tier. This would cap the volume of semantic search requests and is offered at no extra charge. This is the default for newly provisioned search services. */ +/** Known values of {@link SharedPrivateLinkResourceStatus} that the service accepts. */ +export enum KnownSharedPrivateLinkResourceStatus { + /** The shared private link resource has been created and is pending approval. */ + Pending = "Pending", + /** The shared private link resource is approved and is ready for use. */ + Approved = "Approved", + /** The shared private link resource has been rejected and cannot be used. */ + Rejected = "Rejected", + /** The shared private link resource has been removed from the service. */ + Disconnected = "Disconnected", +} + +/** + * Defines values for SharedPrivateLinkResourceStatus. \ + * {@link KnownSharedPrivateLinkResourceStatus} can be used interchangeably with SharedPrivateLinkResourceStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Pending**: The shared private link resource has been created and is pending approval. \ + * **Approved**: The shared private link resource is approved and is ready for use. \ + * **Rejected**: The shared private link resource has been rejected and cannot be used. \ + * **Disconnected**: The shared private link resource has been removed from the service. + */ +export type SharedPrivateLinkResourceStatus = string; + +/** Known values of {@link SharedPrivateLinkResourceProvisioningState} that the service accepts. */ +export enum KnownSharedPrivateLinkResourceProvisioningState { + /** The shared private link resource is in the process of being created along with other resources for it to be fully functional. */ + Updating = "Updating", + /** The shared private link resource is in the process of being deleted. */ + Deleting = "Deleting", + /** The shared private link resource has failed to be provisioned or deleted. */ + Failed = "Failed", + /** The shared private link resource has finished provisioning and is ready for approval. */ + Succeeded = "Succeeded", + /** Provisioning request for the shared private link resource has been accepted but the process of creation has not commenced yet. */ + Incomplete = "Incomplete", +} + +/** + * Defines values for SharedPrivateLinkResourceProvisioningState. \ + * {@link KnownSharedPrivateLinkResourceProvisioningState} can be used interchangeably with SharedPrivateLinkResourceProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Updating**: The shared private link resource is in the process of being created along with other resources for it to be fully functional. \ + * **Deleting**: The shared private link resource is in the process of being deleted. \ + * **Failed**: The shared private link resource has failed to be provisioned or deleted. \ + * **Succeeded**: The shared private link resource has finished provisioning and is ready for approval. \ + * **Incomplete**: Provisioning request for the shared private link resource has been accepted but the process of creation has not commenced yet. + */ +export type SharedPrivateLinkResourceProvisioningState = string; + +/** Known values of {@link SkuName} that the service accepts. */ +export enum KnownSkuName { + /** Free tier, with no SLA guarantees and a subset of the features offered on billable tiers. */ Free = "free", - /** Enables semantic search on a search service as a billable feature, with higher throughput and volume of semantic search queries. */ - Standard = "standard" + /** Billable tier for a dedicated service having up to 3 replicas. */ + Basic = "basic", + /** Billable tier for a dedicated service having up to 12 partitions and 12 replicas. */ + Standard = "standard", + /** Similar to 'standard', but with more capacity per search unit. */ + Standard2 = "standard2", + /** The largest Standard offering with up to 12 partitions and 12 replicas (or up to 3 partitions with more indexes if you also set the hostingMode property to 'highDensity'). */ + Standard3 = "standard3", + /** Billable tier for a dedicated service that supports 1TB per partition, up to 12 partitions. */ + StorageOptimizedL1 = "storage_optimized_l1", + /** Billable tier for a dedicated service that supports 2TB per partition, up to 12 partitions. */ + StorageOptimizedL2 = "storage_optimized_l2", } /** - * Defines values for SearchSemanticSearch. \ - * {@link KnownSearchSemanticSearch} can be used interchangeably with SearchSemanticSearch, + * Defines values for SkuName. \ + * {@link KnownSkuName} can be used interchangeably with SkuName, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **disabled**: Indicates that semantic search is disabled for the search service. \ - * **free**: Enables semantic search on a search service and indicates that it is to be used within the limits of the free tier. This would cap the volume of semantic search requests and is offered at no extra charge. This is the default for newly provisioned search services. \ - * **standard**: Enables semantic search on a search service as a billable feature, with higher throughput and volume of semantic search queries. + * **free**: Free tier, with no SLA guarantees and a subset of the features offered on billable tiers. \ + * **basic**: Billable tier for a dedicated service having up to 3 replicas. \ + * **standard**: Billable tier for a dedicated service having up to 12 partitions and 12 replicas. \ + * **standard2**: Similar to 'standard', but with more capacity per search unit. \ + * **standard3**: The largest Standard offering with up to 12 partitions and 12 replicas (or up to 3 partitions with more indexes if you also set the hostingMode property to 'highDensity'). \ + * **storage_optimized_l1**: Billable tier for a dedicated service that supports 1TB per partition, up to 12 partitions. \ + * **storage_optimized_l2**: Billable tier for a dedicated service that supports 2TB per partition, up to 12 partitions. */ -export type SearchSemanticSearch = string; +export type SkuName = string; + +/** Known values of {@link IdentityType} that the service accepts. */ +export enum KnownIdentityType { + /** Indicates that any identity associated with the search service needs to be removed. */ + None = "None", + /** Indicates that system-assigned identity for the search service will be enabled. */ + SystemAssigned = "SystemAssigned", + /** Indicates that one or more user assigned identities will be assigned to the search service. */ + UserAssigned = "UserAssigned", + /** Indicates that system-assigned identity for the search service will be enabled along with the assignment of one or more user assigned identities. */ + SystemAssignedUserAssigned = "SystemAssigned, UserAssigned", +} + +/** + * Defines values for IdentityType. \ + * {@link KnownIdentityType} can be used interchangeably with IdentityType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None**: Indicates that any identity associated with the search service needs to be removed. \ + * **SystemAssigned**: Indicates that system-assigned identity for the search service will be enabled. \ + * **UserAssigned**: Indicates that one or more user assigned identities will be assigned to the search service. \ + * **SystemAssigned, UserAssigned**: Indicates that system-assigned identity for the search service will be enabled along with the assignment of one or more user assigned identities. + */ +export type IdentityType = string; /** Known values of {@link UnavailableNameReason} that the service accepts. */ export enum KnownUnavailableNameReason { - /** The search service name does not match naming requirements. */ + /** The search service name doesn't match naming requirements. */ Invalid = "Invalid", /** The search service name is already assigned to a different search service. */ - AlreadyExists = "AlreadyExists" + AlreadyExists = "AlreadyExists", } /** @@ -624,7 +1037,7 @@ export enum KnownUnavailableNameReason { * {@link KnownUnavailableNameReason} can be used interchangeably with UnavailableNameReason, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **Invalid**: The search service name does not match naming requirements. \ + * **Invalid**: The search service name doesn't match naming requirements. \ * **AlreadyExists**: The search service name is already assigned to a different search service. */ export type UnavailableNameReason = string; @@ -636,7 +1049,7 @@ export enum KnownSharedPrivateLinkResourceAsyncOperationResult { /** Succeeded */ Succeeded = "Succeeded", /** Failed */ - Failed = "Failed" + Failed = "Failed", } /** @@ -653,8 +1066,6 @@ export type SharedPrivateLinkResourceAsyncOperationResult = string; export type AdminKeyKind = "primary" | "secondary"; /** Defines values for HostingMode. */ export type HostingMode = "default" | "highDensity"; -/** Defines values for PublicNetworkAccess. */ -export type PublicNetworkAccess = "enabled" | "disabled"; /** Defines values for SearchServiceStatus. */ export type SearchServiceStatus = | "running" @@ -662,7 +1073,8 @@ export type SearchServiceStatus = | "deleting" | "degraded" | "disabled" - | "error"; + | "error" + | "stopped"; /** Defines values for ProvisioningState. */ export type ProvisioningState = "succeeded" | "provisioning" | "failed"; /** Defines values for SearchEncryptionWithCmk. */ @@ -677,30 +1089,6 @@ export type PrivateLinkServiceConnectionStatus = | "Approved" | "Rejected" | "Disconnected"; -/** Defines values for SharedPrivateLinkResourceStatus. */ -export type SharedPrivateLinkResourceStatus = - | "Pending" - | "Approved" - | "Rejected" - | "Disconnected"; -/** Defines values for SharedPrivateLinkResourceProvisioningState. */ -export type SharedPrivateLinkResourceProvisioningState = - | "Updating" - | "Deleting" - | "Failed" - | "Succeeded" - | "Incomplete"; -/** Defines values for SkuName. */ -export type SkuName = - | "free" - | "basic" - | "standard" - | "standard2" - | "standard3" - | "storage_optimized_l1" - | "storage_optimized_l2"; -/** Defines values for IdentityType. */ -export type IdentityType = "None" | "SystemAssigned"; /** Optional parameters. */ export interface OperationsListOptionalParams @@ -864,7 +1252,8 @@ export interface PrivateLinkResourcesListSupportedOptionalParams } /** Contains response data for the listSupported operation. */ -export type PrivateLinkResourcesListSupportedResponse = PrivateLinkResourcesResult; +export type PrivateLinkResourcesListSupportedResponse = + PrivateLinkResourcesResult; /** Optional parameters. */ export interface PrivateEndpointConnectionsUpdateOptionalParams @@ -874,7 +1263,8 @@ export interface PrivateEndpointConnectionsUpdateOptionalParams } /** Contains response data for the update operation. */ -export type PrivateEndpointConnectionsUpdateResponse = PrivateEndpointConnection; +export type PrivateEndpointConnectionsUpdateResponse = + PrivateEndpointConnection; /** Optional parameters. */ export interface PrivateEndpointConnectionsGetOptionalParams @@ -894,7 +1284,8 @@ export interface PrivateEndpointConnectionsDeleteOptionalParams } /** Contains response data for the delete operation. */ -export type PrivateEndpointConnectionsDeleteResponse = PrivateEndpointConnection; +export type PrivateEndpointConnectionsDeleteResponse = + PrivateEndpointConnection; /** Optional parameters. */ export interface PrivateEndpointConnectionsListByServiceOptionalParams @@ -904,7 +1295,8 @@ export interface PrivateEndpointConnectionsListByServiceOptionalParams } /** Contains response data for the listByService operation. */ -export type PrivateEndpointConnectionsListByServiceResponse = PrivateEndpointConnectionListResult; +export type PrivateEndpointConnectionsListByServiceResponse = + PrivateEndpointConnectionListResult; /** Optional parameters. */ export interface PrivateEndpointConnectionsListByServiceNextOptionalParams @@ -914,7 +1306,8 @@ export interface PrivateEndpointConnectionsListByServiceNextOptionalParams } /** Contains response data for the listByServiceNext operation. */ -export type PrivateEndpointConnectionsListByServiceNextResponse = PrivateEndpointConnectionListResult; +export type PrivateEndpointConnectionsListByServiceNextResponse = + PrivateEndpointConnectionListResult; /** Optional parameters. */ export interface SharedPrivateLinkResourcesCreateOrUpdateOptionalParams @@ -928,7 +1321,8 @@ export interface SharedPrivateLinkResourcesCreateOrUpdateOptionalParams } /** Contains response data for the createOrUpdate operation. */ -export type SharedPrivateLinkResourcesCreateOrUpdateResponse = SharedPrivateLinkResource; +export type SharedPrivateLinkResourcesCreateOrUpdateResponse = + SharedPrivateLinkResource; /** Optional parameters. */ export interface SharedPrivateLinkResourcesGetOptionalParams @@ -959,7 +1353,8 @@ export interface SharedPrivateLinkResourcesListByServiceOptionalParams } /** Contains response data for the listByService operation. */ -export type SharedPrivateLinkResourcesListByServiceResponse = SharedPrivateLinkResourceListResult; +export type SharedPrivateLinkResourcesListByServiceResponse = + SharedPrivateLinkResourceListResult; /** Optional parameters. */ export interface SharedPrivateLinkResourcesListByServiceNextOptionalParams @@ -969,7 +1364,8 @@ export interface SharedPrivateLinkResourcesListByServiceNextOptionalParams } /** Contains response data for the listByServiceNext operation. */ -export type SharedPrivateLinkResourcesListByServiceNextResponse = SharedPrivateLinkResourceListResult; +export type SharedPrivateLinkResourcesListByServiceNextResponse = + SharedPrivateLinkResourceListResult; /** Optional parameters. */ export interface UsagesListBySubscriptionOptionalParams @@ -1001,6 +1397,43 @@ export interface UsageBySubscriptionSkuOptionalParams /** Contains response data for the usageBySubscriptionSku operation. */ export type UsageBySubscriptionSkuResponse = QuotaUsageResult; +/** Optional parameters. */ +export interface NetworkSecurityPerimeterConfigurationsListByServiceOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByService operation. */ +export type NetworkSecurityPerimeterConfigurationsListByServiceResponse = + NetworkSecurityPerimeterConfigurationListResult; + +/** Optional parameters. */ +export interface NetworkSecurityPerimeterConfigurationsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type NetworkSecurityPerimeterConfigurationsGetResponse = + NetworkSecurityPerimeterConfiguration; + +/** Optional parameters. */ +export interface NetworkSecurityPerimeterConfigurationsReconcileOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the reconcile operation. */ +export type NetworkSecurityPerimeterConfigurationsReconcileResponse = + NetworkSecurityPerimeterConfigurationsReconcileHeaders; + +/** Optional parameters. */ +export interface NetworkSecurityPerimeterConfigurationsListByServiceNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByServiceNext operation. */ +export type NetworkSecurityPerimeterConfigurationsListByServiceNextResponse = + NetworkSecurityPerimeterConfigurationListResult; + /** Optional parameters. */ export interface SearchManagementClientOptionalParams extends coreClient.ServiceClientOptions { diff --git a/sdk/search/arm-search/src/models/mappers.ts b/sdk/search/arm-search/src/models/mappers.ts index 0c50cefe47f2..8210568d8670 100644 --- a/sdk/search/arm-search/src/models/mappers.ts +++ b/sdk/search/arm-search/src/models/mappers.ts @@ -21,20 +21,20 @@ export const OperationListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "Operation" - } - } - } + className: "Operation", + }, + }, + }, }, nextLink: { serializedName: "nextLink", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const Operation: coreClient.CompositeMapper = { @@ -46,18 +46,40 @@ export const Operation: coreClient.CompositeMapper = { serializedName: "name", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, display: { serializedName: "display", type: { name: "Composite", - className: "OperationDisplay" - } - } - } - } + className: "OperationDisplay", + }, + }, + isDataAction: { + serializedName: "isDataAction", + readOnly: true, + nullable: true, + type: { + name: "Boolean", + }, + }, + origin: { + serializedName: "origin", + readOnly: true, + type: { + name: "String", + }, + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "OperationProperties", + }, + }, + }, + }, }; export const OperationDisplay: coreClient.CompositeMapper = { @@ -69,32 +91,229 @@ export const OperationDisplay: coreClient.CompositeMapper = { serializedName: "provider", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, operation: { serializedName: "operation", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, resource: { serializedName: "resource", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, description: { serializedName: "description", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, +}; + +export const OperationProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationProperties", + modelProperties: { + serviceSpecification: { + serializedName: "serviceSpecification", + type: { + name: "Composite", + className: "OperationServiceSpecification", + }, + }, + }, + }, +}; + +export const OperationServiceSpecification: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationServiceSpecification", + modelProperties: { + metricSpecifications: { + serializedName: "metricSpecifications", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "OperationMetricsSpecification", + }, + }, + }, + }, + logSpecifications: { + serializedName: "logSpecifications", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "OperationLogsSpecification", + }, + }, + }, + }, + }, + }, +}; + +export const OperationMetricsSpecification: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationMetricsSpecification", + modelProperties: { + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String", + }, + }, + displayName: { + serializedName: "displayName", + readOnly: true, + type: { + name: "String", + }, + }, + displayDescription: { + serializedName: "displayDescription", + readOnly: true, + type: { + name: "String", + }, + }, + unit: { + serializedName: "unit", + readOnly: true, + type: { + name: "String", + }, + }, + aggregationType: { + serializedName: "aggregationType", + readOnly: true, + type: { + name: "String", + }, + }, + dimensions: { + serializedName: "dimensions", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "OperationMetricDimension", + }, + }, + }, + }, + availabilities: { + serializedName: "availabilities", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "OperationAvailability", + }, + }, + }, + }, + }, + }, +}; + +export const OperationMetricDimension: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationMetricDimension", + modelProperties: { + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String", + }, + }, + displayName: { + serializedName: "displayName", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const OperationAvailability: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationAvailability", + modelProperties: { + timeGrain: { + serializedName: "timeGrain", + readOnly: true, + type: { + name: "String", + }, + }, + blobDuration: { + serializedName: "blobDuration", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const OperationLogsSpecification: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationLogsSpecification", + modelProperties: { + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String", + }, + }, + displayName: { + serializedName: "displayName", + readOnly: true, + type: { + name: "String", + }, + }, + blobDuration: { + serializedName: "blobDuration", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, }; export const CloudError: coreClient.CompositeMapper = { @@ -106,11 +325,17 @@ export const CloudError: coreClient.CompositeMapper = { serializedName: "error", type: { name: "Composite", - className: "CloudErrorBody" - } - } - } - } + className: "CloudErrorBody", + }, + }, + message: { + serializedName: "message", + type: { + name: "String", + }, + }, + }, + }, }; export const CloudErrorBody: coreClient.CompositeMapper = { @@ -121,20 +346,20 @@ export const CloudErrorBody: coreClient.CompositeMapper = { code: { serializedName: "code", type: { - name: "String" - } + name: "String", + }, }, message: { serializedName: "message", type: { - name: "String" - } + name: "String", + }, }, target: { serializedName: "target", type: { - name: "String" - } + name: "String", + }, }, details: { serializedName: "details", @@ -143,13 +368,13 @@ export const CloudErrorBody: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "CloudErrorBody" - } - } - } - } - } - } + className: "CloudErrorBody", + }, + }, + }, + }, + }, + }, }; export const AdminKeyResult: coreClient.CompositeMapper = { @@ -161,18 +386,18 @@ export const AdminKeyResult: coreClient.CompositeMapper = { serializedName: "primaryKey", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, secondaryKey: { serializedName: "secondaryKey", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const QueryKey: coreClient.CompositeMapper = { @@ -184,18 +409,18 @@ export const QueryKey: coreClient.CompositeMapper = { serializedName: "name", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, key: { serializedName: "key", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const ListQueryKeysResult: coreClient.CompositeMapper = { @@ -211,20 +436,20 @@ export const ListQueryKeysResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "QueryKey" - } - } - } + className: "QueryKey", + }, + }, + }, }, nextLink: { serializedName: "nextLink", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const NetworkRuleSet: coreClient.CompositeMapper = { @@ -239,13 +464,19 @@ export const NetworkRuleSet: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "IpRule" - } - } - } - } - } - } + className: "IpRule", + }, + }, + }, + }, + bypass: { + serializedName: "bypass", + type: { + name: "String", + }, + }, + }, + }, }; export const IpRule: coreClient.CompositeMapper = { @@ -256,11 +487,11 @@ export const IpRule: coreClient.CompositeMapper = { value: { serializedName: "value", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const EncryptionWithCmk: coreClient.CompositeMapper = { @@ -272,19 +503,19 @@ export const EncryptionWithCmk: coreClient.CompositeMapper = { serializedName: "enforcement", type: { name: "Enum", - allowedValues: ["Disabled", "Enabled", "Unspecified"] - } + allowedValues: ["Disabled", "Enabled", "Unspecified"], + }, }, encryptionComplianceStatus: { serializedName: "encryptionComplianceStatus", readOnly: true, type: { name: "Enum", - allowedValues: ["Compliant", "NonCompliant"] - } - } - } - } + allowedValues: ["Compliant", "NonCompliant"], + }, + }, + }, + }, }; export const DataPlaneAuthOptions: coreClient.CompositeMapper = { @@ -296,18 +527,18 @@ export const DataPlaneAuthOptions: coreClient.CompositeMapper = { serializedName: "apiKeyOnly", type: { name: "Dictionary", - value: { type: { name: "any" } } - } + value: { type: { name: "any" } }, + }, }, aadOrApiKey: { serializedName: "aadOrApiKey", type: { name: "Composite", - className: "DataPlaneAadOrApiKeyAuthOption" - } - } - } - } + className: "DataPlaneAadOrApiKeyAuthOption", + }, + }, + }, + }, }; export const DataPlaneAadOrApiKeyAuthOption: coreClient.CompositeMapper = { @@ -319,11 +550,11 @@ export const DataPlaneAadOrApiKeyAuthOption: coreClient.CompositeMapper = { serializedName: "aadAuthFailureMode", type: { name: "Enum", - allowedValues: ["http403", "http401WithBearerChallenge"] - } - } - } - } + allowedValues: ["http403", "http401WithBearerChallenge"], + }, + }, + }, + }, }; export const PrivateEndpointConnectionProperties: coreClient.CompositeMapper = { @@ -335,77 +566,79 @@ export const PrivateEndpointConnectionProperties: coreClient.CompositeMapper = { serializedName: "privateEndpoint", type: { name: "Composite", - className: "PrivateEndpointConnectionPropertiesPrivateEndpoint" - } + className: "PrivateEndpointConnectionPropertiesPrivateEndpoint", + }, }, privateLinkServiceConnectionState: { serializedName: "privateLinkServiceConnectionState", type: { name: "Composite", className: - "PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState" - } + "PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState", + }, }, groupId: { serializedName: "groupId", type: { - name: "String" - } + name: "String", + }, }, provisioningState: { serializedName: "provisioningState", type: { - name: "String" - } - } - } - } -}; - -export const PrivateEndpointConnectionPropertiesPrivateEndpoint: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PrivateEndpointConnectionPropertiesPrivateEndpoint", - modelProperties: { - id: { - serializedName: "id", - type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; -export const PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: - "PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState", - modelProperties: { - status: { - serializedName: "status", - type: { - name: "Enum", - allowedValues: ["Pending", "Approved", "Rejected", "Disconnected"] - } +export const PrivateEndpointConnectionPropertiesPrivateEndpoint: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "PrivateEndpointConnectionPropertiesPrivateEndpoint", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String", + }, + }, }, - description: { - serializedName: "description", - type: { - name: "String" - } + }, + }; + +export const PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: + "PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState", + modelProperties: { + status: { + serializedName: "status", + type: { + name: "Enum", + allowedValues: ["Pending", "Approved", "Rejected", "Disconnected"], + }, + }, + description: { + serializedName: "description", + type: { + name: "String", + }, + }, + actionsRequired: { + defaultValue: "None", + serializedName: "actionsRequired", + type: { + name: "String", + }, + }, }, - actionsRequired: { - defaultValue: "None", - serializedName: "actionsRequired", - type: { - name: "String" - } - } - } - } -}; + }, + }; export const Resource: coreClient.CompositeMapper = { type: { @@ -416,25 +649,25 @@ export const Resource: coreClient.CompositeMapper = { serializedName: "id", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, name: { serializedName: "name", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, type: { serializedName: "type", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const SharedPrivateLinkResourceProperties: coreClient.CompositeMapper = { @@ -445,49 +678,41 @@ export const SharedPrivateLinkResourceProperties: coreClient.CompositeMapper = { privateLinkResourceId: { serializedName: "privateLinkResourceId", type: { - name: "String" - } + name: "String", + }, }, groupId: { serializedName: "groupId", type: { - name: "String" - } + name: "String", + }, }, requestMessage: { serializedName: "requestMessage", type: { - name: "String" - } + name: "String", + }, }, resourceRegion: { serializedName: "resourceRegion", type: { - name: "String" - } + name: "String", + }, }, status: { serializedName: "status", type: { - name: "Enum", - allowedValues: ["Pending", "Approved", "Rejected", "Disconnected"] - } + name: "String", + }, }, provisioningState: { serializedName: "provisioningState", type: { - name: "Enum", - allowedValues: [ - "Updating", - "Deleting", - "Failed", - "Succeeded", - "Incomplete" - ] - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const Sku: coreClient.CompositeMapper = { @@ -498,20 +723,11 @@ export const Sku: coreClient.CompositeMapper = { name: { serializedName: "name", type: { - name: "Enum", - allowedValues: [ - "free", - "basic", - "standard", - "standard2", - "standard3", - "storage_optimized_l1", - "storage_optimized_l2" - ] - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const Identity: coreClient.CompositeMapper = { @@ -523,26 +739,60 @@ export const Identity: coreClient.CompositeMapper = { serializedName: "principalId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, tenantId: { serializedName: "tenantId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, type: { serializedName: "type", required: true, type: { - name: "Enum", - allowedValues: ["None", "SystemAssigned"] - } - } - } - } + name: "String", + }, + }, + userAssignedIdentities: { + serializedName: "userAssignedIdentities", + type: { + name: "Dictionary", + value: { + type: { + name: "Composite", + className: "UserAssignedManagedIdentity", + }, + }, + }, + }, + }, + }, +}; + +export const UserAssignedManagedIdentity: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "UserAssignedManagedIdentity", + modelProperties: { + principalId: { + serializedName: "principalId", + readOnly: true, + type: { + name: "String", + }, + }, + clientId: { + serializedName: "clientId", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, }; export const SearchServiceListResult: coreClient.CompositeMapper = { @@ -558,20 +808,20 @@ export const SearchServiceListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "SearchService" - } - } - } + className: "SearchService", + }, + }, + }, }, nextLink: { serializedName: "nextLink", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const PrivateLinkResourcesResult: coreClient.CompositeMapper = { @@ -587,13 +837,13 @@ export const PrivateLinkResourcesResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "PrivateLinkResource" - } - } - } - } - } - } + className: "PrivateLinkResource", + }, + }, + }, + }, + }, + }, }; export const PrivateLinkResourceProperties: coreClient.CompositeMapper = { @@ -605,8 +855,8 @@ export const PrivateLinkResourceProperties: coreClient.CompositeMapper = { serializedName: "groupId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, requiredMembers: { serializedName: "requiredMembers", @@ -615,10 +865,10 @@ export const PrivateLinkResourceProperties: coreClient.CompositeMapper = { name: "Sequence", element: { type: { - name: "String" - } - } - } + name: "String", + }, + }, + }, }, requiredZoneNames: { serializedName: "requiredZoneNames", @@ -627,10 +877,10 @@ export const PrivateLinkResourceProperties: coreClient.CompositeMapper = { name: "Sequence", element: { type: { - name: "String" - } - } - } + name: "String", + }, + }, + }, }, shareablePrivateLinkResourceTypes: { serializedName: "shareablePrivateLinkResourceTypes", @@ -640,267 +890,560 @@ export const PrivateLinkResourceProperties: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ShareablePrivateLinkResourceType" - } - } - } - } - } - } + className: "ShareablePrivateLinkResourceType", + }, + }, + }, + }, + }, + }, +}; + +export const ShareablePrivateLinkResourceType: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ShareablePrivateLinkResourceType", + modelProperties: { + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String", + }, + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "ShareablePrivateLinkResourceProperties", + }, + }, + }, + }, +}; + +export const ShareablePrivateLinkResourceProperties: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "ShareablePrivateLinkResourceProperties", + modelProperties: { + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String", + }, + }, + groupId: { + serializedName: "groupId", + readOnly: true, + type: { + name: "String", + }, + }, + description: { + serializedName: "description", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, + }; + +export const PrivateEndpointConnectionListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateEndpointConnectionListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateEndpointConnection", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const SharedPrivateLinkResourceListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SharedPrivateLinkResourceListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SharedPrivateLinkResource", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const CheckNameAvailabilityInput: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CheckNameAvailabilityInput", + modelProperties: { + name: { + serializedName: "name", + required: true, + type: { + name: "String", + }, + }, + typeParam: { + defaultValue: "searchServices", + isConstant: true, + serializedName: "type", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const CheckNameAvailabilityOutput: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CheckNameAvailabilityOutput", + modelProperties: { + isNameAvailable: { + serializedName: "nameAvailable", + readOnly: true, + type: { + name: "Boolean", + }, + }, + reason: { + serializedName: "reason", + readOnly: true, + type: { + name: "String", + }, + }, + message: { + serializedName: "message", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const QuotaUsagesListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "QuotaUsagesListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "QuotaUsageResult", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const QuotaUsageResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "QuotaUsageResult", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String", + }, + }, + unit: { + serializedName: "unit", + type: { + name: "String", + }, + }, + currentValue: { + serializedName: "currentValue", + type: { + name: "Number", + }, + }, + limit: { + serializedName: "limit", + type: { + name: "Number", + }, + }, + name: { + serializedName: "name", + type: { + name: "Composite", + className: "QuotaUsageResultName", + }, + }, + }, + }, +}; + +export const QuotaUsageResultName: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "QuotaUsageResultName", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "String", + }, + }, + localizedValue: { + serializedName: "localizedValue", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const NetworkSecurityPerimeterConfigurationListResult: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "NetworkSecurityPerimeterConfigurationListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NetworkSecurityPerimeterConfiguration", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, + }; + +export const NSPConfigPerimeter: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "NSPConfigPerimeter", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String", + }, + }, + perimeterGuid: { + serializedName: "perimeterGuid", + type: { + name: "String", + }, + }, + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const NSPConfigAssociation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "NSPConfigAssociation", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String", + }, + }, + accessMode: { + serializedName: "accessMode", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const NSPConfigProfile: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "NSPConfigProfile", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String", + }, + }, + accessRulesVersion: { + serializedName: "accessRulesVersion", + type: { + name: "String", + }, + }, + accessRules: { + serializedName: "accessRules", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NSPConfigAccessRule", + }, + }, + }, + }, + }, + }, }; -export const ShareablePrivateLinkResourceType: coreClient.CompositeMapper = { +export const NSPConfigAccessRule: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ShareablePrivateLinkResourceType", + className: "NSPConfigAccessRule", modelProperties: { name: { serializedName: "name", - readOnly: true, type: { - name: "String" - } + name: "String", + }, }, properties: { serializedName: "properties", type: { name: "Composite", - className: "ShareablePrivateLinkResourceProperties" - } - } - } - } + className: "NSPConfigAccessRuleProperties", + }, + }, + }, + }, }; -export const ShareablePrivateLinkResourceProperties: coreClient.CompositeMapper = { +export const NSPConfigAccessRuleProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ShareablePrivateLinkResourceProperties", + className: "NSPConfigAccessRuleProperties", modelProperties: { - type: { - serializedName: "type", - readOnly: true, + direction: { + serializedName: "direction", type: { - name: "String" - } + name: "String", + }, }, - groupId: { - serializedName: "groupId", - readOnly: true, + addressPrefixes: { + serializedName: "addressPrefixes", type: { - name: "String" - } + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, }, - description: { - serializedName: "description", - readOnly: true, - type: { - name: "String" - } - } - } - } -}; - -export const PrivateEndpointConnectionListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PrivateEndpointConnectionListResult", - modelProperties: { - value: { - serializedName: "value", - readOnly: true, + fullyQualifiedDomainNames: { + serializedName: "fullyQualifiedDomainNames", type: { name: "Sequence", element: { type: { - name: "Composite", - className: "PrivateEndpointConnection" - } - } - } + name: "String", + }, + }, + }, }, - nextLink: { - serializedName: "nextLink", - readOnly: true, + subscriptions: { + serializedName: "subscriptions", type: { - name: "String" - } - } - } - } -}; - -export const SharedPrivateLinkResourceListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SharedPrivateLinkResourceListResult", - modelProperties: { - value: { - serializedName: "value", - readOnly: true, + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + networkSecurityPerimeters: { + serializedName: "networkSecurityPerimeters", type: { name: "Sequence", element: { type: { name: "Composite", - className: "SharedPrivateLinkResource" - } - } - } + className: "NSPConfigNetworkSecurityPerimeterRule", + }, + }, + }, }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String" - } - } - } - } + }, + }, }; -export const CheckNameAvailabilityInput: coreClient.CompositeMapper = { +export const NSPConfigNetworkSecurityPerimeterRule: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "NSPConfigNetworkSecurityPerimeterRule", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String", + }, + }, + perimeterGuid: { + serializedName: "perimeterGuid", + type: { + name: "String", + }, + }, + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + }, + }, + }; + +export const NSPProvisioningIssue: coreClient.CompositeMapper = { type: { name: "Composite", - className: "CheckNameAvailabilityInput", + className: "NSPProvisioningIssue", modelProperties: { name: { serializedName: "name", - required: true, type: { - name: "String" - } + name: "String", + }, }, - typeParam: { - defaultValue: "searchServices", - isConstant: true, - serializedName: "type", + properties: { + serializedName: "properties", type: { - name: "String" - } - } - } - } + name: "Composite", + className: "NSPProvisioningIssueProperties", + }, + }, + }, + }, }; -export const CheckNameAvailabilityOutput: coreClient.CompositeMapper = { +export const NSPProvisioningIssueProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "CheckNameAvailabilityOutput", + className: "NSPProvisioningIssueProperties", modelProperties: { - isNameAvailable: { - serializedName: "nameAvailable", - readOnly: true, + issueType: { + serializedName: "issueType", type: { - name: "Boolean" - } + name: "String", + }, }, - reason: { - serializedName: "reason", - readOnly: true, + severity: { + serializedName: "severity", type: { - name: "String" - } + name: "String", + }, }, - message: { - serializedName: "message", - readOnly: true, + description: { + serializedName: "description", type: { - name: "String" - } - } - } - } -}; - -export const QuotaUsagesListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "QuotaUsagesListResult", - modelProperties: { - value: { - serializedName: "value", - readOnly: true, + name: "String", + }, + }, + suggestedResourceIds: { + serializedName: "suggestedResourceIds", type: { name: "Sequence", element: { type: { - name: "Composite", - className: "QuotaUsageResult" - } - } - } - }, - nextLink: { - serializedName: "nextLink", - readOnly: true, - type: { - name: "String" - } - } - } - } -}; - -export const QuotaUsageResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "QuotaUsageResult", - modelProperties: { - id: { - serializedName: "id", - type: { - name: "String" - } - }, - unit: { - serializedName: "unit", - type: { - name: "String" - } - }, - currentValue: { - serializedName: "currentValue", - type: { - name: "Number" - } - }, - limit: { - serializedName: "limit", - type: { - name: "Number" - } + name: "String", + }, + }, + }, }, - name: { - serializedName: "name", - type: { - name: "Composite", - className: "QuotaUsageResultName" - } - } - } - } -}; - -export const QuotaUsageResultName: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "QuotaUsageResultName", - modelProperties: { - value: { - serializedName: "value", + suggestedAccessRules: { + serializedName: "suggestedAccessRules", type: { - name: "String" - } + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, }, - localizedValue: { - serializedName: "localizedValue", - type: { - name: "String" - } - } - } - } + }, + }, }; export const AsyncOperationResult: coreClient.CompositeMapper = { @@ -911,11 +1454,11 @@ export const AsyncOperationResult: coreClient.CompositeMapper = { status: { serializedName: "status", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const PrivateEndpointConnection: coreClient.CompositeMapper = { @@ -928,11 +1471,11 @@ export const PrivateEndpointConnection: coreClient.CompositeMapper = { serializedName: "properties", type: { name: "Composite", - className: "PrivateEndpointConnectionProperties" - } - } - } - } + className: "PrivateEndpointConnectionProperties", + }, + }, + }, + }, }; export const SharedPrivateLinkResource: coreClient.CompositeMapper = { @@ -945,11 +1488,11 @@ export const SharedPrivateLinkResource: coreClient.CompositeMapper = { serializedName: "properties", type: { name: "Composite", - className: "SharedPrivateLinkResourceProperties" - } - } - } - } + className: "SharedPrivateLinkResourceProperties", + }, + }, + }, + }, }; export const TrackedResource: coreClient.CompositeMapper = { @@ -962,18 +1505,18 @@ export const TrackedResource: coreClient.CompositeMapper = { serializedName: "tags", type: { name: "Dictionary", - value: { type: { name: "String" } } - } + value: { type: { name: "String" } }, + }, }, location: { serializedName: "location", required: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const SearchServiceUpdate: coreClient.CompositeMapper = { @@ -986,66 +1529,65 @@ export const SearchServiceUpdate: coreClient.CompositeMapper = { serializedName: "sku", type: { name: "Composite", - className: "Sku" - } + className: "Sku", + }, }, location: { serializedName: "location", type: { - name: "String" - } + name: "String", + }, }, tags: { serializedName: "tags", type: { name: "Dictionary", - value: { type: { name: "String" } } - } + value: { type: { name: "String" } }, + }, }, identity: { serializedName: "identity", type: { name: "Composite", - className: "Identity" - } + className: "Identity", + }, }, replicaCount: { defaultValue: 1, constraints: { InclusiveMaximum: 12, - InclusiveMinimum: 1 + InclusiveMinimum: 1, }, serializedName: "properties.replicaCount", type: { - name: "Number" - } + name: "Number", + }, }, partitionCount: { defaultValue: 1, constraints: { InclusiveMaximum: 12, - InclusiveMinimum: 1 + InclusiveMinimum: 1, }, serializedName: "properties.partitionCount", type: { - name: "Number" - } + name: "Number", + }, }, hostingMode: { defaultValue: "default", serializedName: "properties.hostingMode", type: { name: "Enum", - allowedValues: ["default", "highDensity"] - } + allowedValues: ["default", "highDensity"], + }, }, publicNetworkAccess: { defaultValue: "enabled", serializedName: "properties.publicNetworkAccess", type: { - name: "Enum", - allowedValues: ["enabled", "disabled"] - } + name: "String", + }, }, status: { serializedName: "properties.status", @@ -1058,52 +1600,71 @@ export const SearchServiceUpdate: coreClient.CompositeMapper = { "deleting", "degraded", "disabled", - "error" - ] - } + "error", + "stopped", + ], + }, }, statusDetails: { serializedName: "properties.statusDetails", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, provisioningState: { serializedName: "properties.provisioningState", readOnly: true, type: { name: "Enum", - allowedValues: ["succeeded", "provisioning", "failed"] - } + allowedValues: ["succeeded", "provisioning", "failed"], + }, }, networkRuleSet: { serializedName: "properties.networkRuleSet", type: { name: "Composite", - className: "NetworkRuleSet" - } + className: "NetworkRuleSet", + }, + }, + disabledDataExfiltrationOptions: { + serializedName: "properties.disabledDataExfiltrationOptions", + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, }, encryptionWithCmk: { serializedName: "properties.encryptionWithCmk", type: { name: "Composite", - className: "EncryptionWithCmk" - } + className: "EncryptionWithCmk", + }, }, disableLocalAuth: { serializedName: "properties.disableLocalAuth", nullable: true, type: { - name: "Boolean" - } + name: "Boolean", + }, }, authOptions: { serializedName: "properties.authOptions", type: { name: "Composite", - className: "DataPlaneAuthOptions" - } + className: "DataPlaneAuthOptions", + }, + }, + semanticSearch: { + serializedName: "properties.semanticSearch", + nullable: true, + type: { + name: "String", + }, }, privateEndpointConnections: { serializedName: "properties.privateEndpointConnections", @@ -1113,17 +1674,10 @@ export const SearchServiceUpdate: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "PrivateEndpointConnection" - } - } - } - }, - semanticSearch: { - serializedName: "properties.semanticSearch", - nullable: true, - type: { - name: "String" - } + className: "PrivateEndpointConnection", + }, + }, + }, }, sharedPrivateLinkResources: { serializedName: "properties.sharedPrivateLinkResources", @@ -1133,13 +1687,20 @@ export const SearchServiceUpdate: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "SharedPrivateLinkResource" - } - } - } - } - } - } + className: "SharedPrivateLinkResource", + }, + }, + }, + }, + eTag: { + serializedName: "properties.eTag", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, }; export const PrivateLinkResource: coreClient.CompositeMapper = { @@ -1152,11 +1713,21 @@ export const PrivateLinkResource: coreClient.CompositeMapper = { serializedName: "properties", type: { name: "Composite", - className: "PrivateLinkResourceProperties" - } - } - } - } + className: "PrivateLinkResourceProperties", + }, + }, + }, + }, +}; + +export const ProxyResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProxyResource", + modelProperties: { + ...Resource.type.modelProperties, + }, + }, }; export const SearchService: coreClient.CompositeMapper = { @@ -1169,53 +1740,52 @@ export const SearchService: coreClient.CompositeMapper = { serializedName: "sku", type: { name: "Composite", - className: "Sku" - } + className: "Sku", + }, }, identity: { serializedName: "identity", type: { name: "Composite", - className: "Identity" - } + className: "Identity", + }, }, replicaCount: { defaultValue: 1, constraints: { InclusiveMaximum: 12, - InclusiveMinimum: 1 + InclusiveMinimum: 1, }, serializedName: "properties.replicaCount", type: { - name: "Number" - } + name: "Number", + }, }, partitionCount: { defaultValue: 1, constraints: { InclusiveMaximum: 12, - InclusiveMinimum: 1 + InclusiveMinimum: 1, }, serializedName: "properties.partitionCount", type: { - name: "Number" - } + name: "Number", + }, }, hostingMode: { defaultValue: "default", serializedName: "properties.hostingMode", type: { name: "Enum", - allowedValues: ["default", "highDensity"] - } + allowedValues: ["default", "highDensity"], + }, }, publicNetworkAccess: { defaultValue: "enabled", serializedName: "properties.publicNetworkAccess", type: { - name: "Enum", - allowedValues: ["enabled", "disabled"] - } + name: "String", + }, }, status: { serializedName: "properties.status", @@ -1228,52 +1798,71 @@ export const SearchService: coreClient.CompositeMapper = { "deleting", "degraded", "disabled", - "error" - ] - } + "error", + "stopped", + ], + }, }, statusDetails: { serializedName: "properties.statusDetails", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, provisioningState: { serializedName: "properties.provisioningState", readOnly: true, type: { name: "Enum", - allowedValues: ["succeeded", "provisioning", "failed"] - } + allowedValues: ["succeeded", "provisioning", "failed"], + }, }, networkRuleSet: { serializedName: "properties.networkRuleSet", type: { name: "Composite", - className: "NetworkRuleSet" - } + className: "NetworkRuleSet", + }, + }, + disabledDataExfiltrationOptions: { + serializedName: "properties.disabledDataExfiltrationOptions", + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, }, encryptionWithCmk: { serializedName: "properties.encryptionWithCmk", type: { name: "Composite", - className: "EncryptionWithCmk" - } + className: "EncryptionWithCmk", + }, }, disableLocalAuth: { serializedName: "properties.disableLocalAuth", nullable: true, type: { - name: "Boolean" - } + name: "Boolean", + }, }, authOptions: { serializedName: "properties.authOptions", type: { name: "Composite", - className: "DataPlaneAuthOptions" - } + className: "DataPlaneAuthOptions", + }, + }, + semanticSearch: { + serializedName: "properties.semanticSearch", + nullable: true, + type: { + name: "String", + }, }, privateEndpointConnections: { serializedName: "properties.privateEndpointConnections", @@ -1283,17 +1872,10 @@ export const SearchService: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "PrivateEndpointConnection" - } - } - } - }, - semanticSearch: { - serializedName: "properties.semanticSearch", - nullable: true, - type: { - name: "String" - } + className: "PrivateEndpointConnection", + }, + }, + }, }, sharedPrivateLinkResources: { serializedName: "properties.sharedPrivateLinkResources", @@ -1303,11 +1885,85 @@ export const SearchService: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "SharedPrivateLinkResource" - } - } - } - } - } - } + className: "SharedPrivateLinkResource", + }, + }, + }, + }, + eTag: { + serializedName: "properties.eTag", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, }; + +export const NetworkSecurityPerimeterConfiguration: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "NetworkSecurityPerimeterConfiguration", + modelProperties: { + ...ProxyResource.type.modelProperties, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String", + }, + }, + networkSecurityPerimeter: { + serializedName: "properties.networkSecurityPerimeter", + type: { + name: "Composite", + className: "NSPConfigPerimeter", + }, + }, + resourceAssociation: { + serializedName: "properties.resourceAssociation", + type: { + name: "Composite", + className: "NSPConfigAssociation", + }, + }, + profile: { + serializedName: "properties.profile", + type: { + name: "Composite", + className: "NSPConfigProfile", + }, + }, + provisioningIssues: { + serializedName: "properties.provisioningIssues", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NSPProvisioningIssue", + }, + }, + }, + }, + }, + }, + }; + +export const NetworkSecurityPerimeterConfigurationsReconcileHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "NetworkSecurityPerimeterConfigurationsReconcileHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + }, + }, + }; diff --git a/sdk/search/arm-search/src/models/parameters.ts b/sdk/search/arm-search/src/models/parameters.ts index b9f3c5a22729..c8d0e4f50a30 100644 --- a/sdk/search/arm-search/src/models/parameters.ts +++ b/sdk/search/arm-search/src/models/parameters.ts @@ -9,14 +9,14 @@ import { OperationParameter, OperationURLParameter, - OperationQueryParameter + OperationQueryParameter, } from "@azure/core-client"; import { SearchService as SearchServiceMapper, SearchServiceUpdate as SearchServiceUpdateMapper, CheckNameAvailabilityInput as CheckNameAvailabilityInputMapper, PrivateEndpointConnection as PrivateEndpointConnectionMapper, - SharedPrivateLinkResource as SharedPrivateLinkResourceMapper + SharedPrivateLinkResource as SharedPrivateLinkResourceMapper, } from "../models/mappers"; export const accept: OperationParameter = { @@ -26,9 +26,9 @@ export const accept: OperationParameter = { isConstant: true, serializedName: "Accept", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const $host: OperationURLParameter = { @@ -37,22 +37,22 @@ export const $host: OperationURLParameter = { serializedName: "$host", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2023-11-01", + defaultValue: "2024-03-01-preview", isConstant: true, serializedName: "api-version", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const resourceGroupName: OperationURLParameter = { @@ -61,34 +61,37 @@ export const resourceGroupName: OperationURLParameter = { serializedName: "resourceGroupName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const searchServiceName: OperationURLParameter = { parameterPath: "searchServiceName", mapper: { + constraints: { + Pattern: new RegExp("^(?=.{2,60}$)[a-z0-9][a-z0-9]+(-[a-z0-9]+)*$"), + }, serializedName: "searchServiceName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const clientRequestId: OperationParameter = { parameterPath: [ "options", "searchManagementRequestOptions", - "clientRequestId" + "clientRequestId", ], mapper: { serializedName: "x-ms-client-request-id", type: { - name: "Uuid" - } - } + name: "Uuid", + }, + }, }; export const subscriptionId: OperationURLParameter = { @@ -97,9 +100,9 @@ export const subscriptionId: OperationURLParameter = { serializedName: "subscriptionId", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const keyKind: OperationURLParameter = { @@ -109,9 +112,9 @@ export const keyKind: OperationURLParameter = { required: true, type: { name: "Enum", - allowedValues: ["primary", "secondary"] - } - } + allowedValues: ["primary", "secondary"], + }, + }, }; export const name: OperationURLParameter = { @@ -120,9 +123,9 @@ export const name: OperationURLParameter = { serializedName: "name", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const key: OperationURLParameter = { @@ -131,9 +134,9 @@ export const key: OperationURLParameter = { serializedName: "key", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const nextLink: OperationURLParameter = { @@ -142,10 +145,10 @@ export const nextLink: OperationURLParameter = { serializedName: "nextLink", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; export const contentType: OperationParameter = { @@ -155,34 +158,45 @@ export const contentType: OperationParameter = { isConstant: true, serializedName: "Content-Type", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const service: OperationParameter = { parameterPath: "service", - mapper: SearchServiceMapper + mapper: SearchServiceMapper, +}; + +export const searchServiceName1: OperationURLParameter = { + parameterPath: "searchServiceName", + mapper: { + serializedName: "searchServiceName", + required: true, + type: { + name: "String", + }, + }, }; export const service1: OperationParameter = { parameterPath: "service", - mapper: SearchServiceUpdateMapper + mapper: SearchServiceUpdateMapper, }; export const name1: OperationParameter = { parameterPath: "name", - mapper: CheckNameAvailabilityInputMapper + mapper: CheckNameAvailabilityInputMapper, }; export const typeParam: OperationParameter = { parameterPath: "typeParam", - mapper: CheckNameAvailabilityInputMapper + mapper: CheckNameAvailabilityInputMapper, }; export const privateEndpointConnection: OperationParameter = { parameterPath: "privateEndpointConnection", - mapper: PrivateEndpointConnectionMapper + mapper: PrivateEndpointConnectionMapper, }; export const privateEndpointConnectionName: OperationURLParameter = { @@ -191,14 +205,14 @@ export const privateEndpointConnectionName: OperationURLParameter = { serializedName: "privateEndpointConnectionName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const sharedPrivateLinkResource: OperationParameter = { parameterPath: "sharedPrivateLinkResource", - mapper: SharedPrivateLinkResourceMapper + mapper: SharedPrivateLinkResourceMapper, }; export const sharedPrivateLinkResourceName: OperationURLParameter = { @@ -207,9 +221,9 @@ export const sharedPrivateLinkResourceName: OperationURLParameter = { serializedName: "sharedPrivateLinkResourceName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const location: OperationURLParameter = { @@ -218,9 +232,9 @@ export const location: OperationURLParameter = { serializedName: "location", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const skuName: OperationURLParameter = { @@ -229,7 +243,25 @@ export const skuName: OperationURLParameter = { serializedName: "skuName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, +}; + +export const nspConfigName: OperationURLParameter = { + parameterPath: "nspConfigName", + mapper: { + constraints: { + Pattern: new RegExp( + "^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}\\.[a-z][a-z0-9]*$", + ), + MaxLength: 100, + MinLength: 38, + }, + serializedName: "nspConfigName", + required: true, + type: { + name: "String", + }, + }, }; diff --git a/sdk/search/arm-search/src/operations/adminKeys.ts b/sdk/search/arm-search/src/operations/adminKeys.ts index 4c0578328d81..9cd6560886d3 100644 --- a/sdk/search/arm-search/src/operations/adminKeys.ts +++ b/sdk/search/arm-search/src/operations/adminKeys.ts @@ -16,7 +16,7 @@ import { AdminKeysGetResponse, AdminKeyKind, AdminKeysRegenerateOptionalParams, - AdminKeysRegenerateResponse + AdminKeysRegenerateResponse, } from "../models"; /** Class containing AdminKeys operations. */ @@ -32,21 +32,21 @@ export class AdminKeysImpl implements AdminKeys { } /** - * Gets the primary and secondary admin API keys for the specified Azure Cognitive Search service. + * Gets the primary and secondary admin API keys for the specified Azure AI Search service. * @param resourceGroupName The name of the resource group within the current subscription. You can * obtain this value from the Azure Resource Manager API or the portal. - * @param searchServiceName The name of the Azure Cognitive Search service associated with the - * specified resource group. + * @param searchServiceName The name of the Azure AI Search service associated with the specified + * resource group. * @param options The options parameters. */ get( resourceGroupName: string, searchServiceName: string, - options?: AdminKeysGetOptionalParams + options?: AdminKeysGetOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, searchServiceName, options }, - getOperationSpec + getOperationSpec, ); } @@ -55,8 +55,8 @@ export class AdminKeysImpl implements AdminKeys { * time. * @param resourceGroupName The name of the resource group within the current subscription. You can * obtain this value from the Azure Resource Manager API or the portal. - * @param searchServiceName The name of the Azure Cognitive Search service associated with the - * specified resource group. + * @param searchServiceName The name of the Azure AI Search service associated with the specified + * resource group. * @param keyKind Specifies which key to regenerate. Valid values include 'primary' and 'secondary'. * @param options The options parameters. */ @@ -64,11 +64,11 @@ export class AdminKeysImpl implements AdminKeys { resourceGroupName: string, searchServiceName: string, keyKind: AdminKeyKind, - options?: AdminKeysRegenerateOptionalParams + options?: AdminKeysRegenerateOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, searchServiceName, keyKind, options }, - regenerateOperationSpec + regenerateOperationSpec, ); } } @@ -76,38 +76,36 @@ export class AdminKeysImpl implements AdminKeys { const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/listAdminKeys", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/listAdminKeys", httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.AdminKeyResult + bodyMapper: Mappers.AdminKeyResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, Parameters.searchServiceName, - Parameters.subscriptionId + Parameters.subscriptionId, ], headerParameters: [Parameters.accept, Parameters.clientRequestId], - serializer + serializer, }; const regenerateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/regenerateAdminKey/{keyKind}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/regenerateAdminKey/{keyKind}", httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.AdminKeyResult + bodyMapper: Mappers.AdminKeyResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ @@ -115,8 +113,8 @@ const regenerateOperationSpec: coreClient.OperationSpec = { Parameters.resourceGroupName, Parameters.searchServiceName, Parameters.subscriptionId, - Parameters.keyKind + Parameters.keyKind, ], headerParameters: [Parameters.accept, Parameters.clientRequestId], - serializer + serializer, }; diff --git a/sdk/search/arm-search/src/operations/index.ts b/sdk/search/arm-search/src/operations/index.ts index f60f5a357ae2..e8c3c318ae97 100644 --- a/sdk/search/arm-search/src/operations/index.ts +++ b/sdk/search/arm-search/src/operations/index.ts @@ -14,3 +14,4 @@ export * from "./privateLinkResources"; export * from "./privateEndpointConnections"; export * from "./sharedPrivateLinkResources"; export * from "./usages"; +export * from "./networkSecurityPerimeterConfigurations"; diff --git a/sdk/search/arm-search/src/operations/networkSecurityPerimeterConfigurations.ts b/sdk/search/arm-search/src/operations/networkSecurityPerimeterConfigurations.ts new file mode 100644 index 000000000000..3e0763a32861 --- /dev/null +++ b/sdk/search/arm-search/src/operations/networkSecurityPerimeterConfigurations.ts @@ -0,0 +1,400 @@ +/* + * 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"; +import { NetworkSecurityPerimeterConfigurations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { SearchManagementClient } from "../searchManagementClient"; +import { + SimplePollerLike, + OperationState, + createHttpPoller, +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + NetworkSecurityPerimeterConfiguration, + NetworkSecurityPerimeterConfigurationsListByServiceNextOptionalParams, + NetworkSecurityPerimeterConfigurationsListByServiceOptionalParams, + NetworkSecurityPerimeterConfigurationsListByServiceResponse, + NetworkSecurityPerimeterConfigurationsGetOptionalParams, + NetworkSecurityPerimeterConfigurationsGetResponse, + NetworkSecurityPerimeterConfigurationsReconcileOptionalParams, + NetworkSecurityPerimeterConfigurationsReconcileResponse, + NetworkSecurityPerimeterConfigurationsListByServiceNextResponse, +} from "../models"; + +/// +/** Class containing NetworkSecurityPerimeterConfigurations operations. */ +export class NetworkSecurityPerimeterConfigurationsImpl + implements NetworkSecurityPerimeterConfigurations +{ + private readonly client: SearchManagementClient; + + /** + * Initialize a new instance of the class NetworkSecurityPerimeterConfigurations class. + * @param client Reference to the service client + */ + constructor(client: SearchManagementClient) { + this.client = client; + } + + /** + * Gets a list of network security perimeter configurations for a search service. + * @param resourceGroupName The name of the resource group within the current subscription. You can + * obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure AI Search service associated with the specified + * resource group. + * @param options The options parameters. + */ + public listByService( + resourceGroupName: string, + searchServiceName: string, + options?: NetworkSecurityPerimeterConfigurationsListByServiceOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByServicePagingAll( + resourceGroupName, + searchServiceName, + 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.listByServicePagingPage( + resourceGroupName, + searchServiceName, + options, + settings, + ); + }, + }; + } + + private async *listByServicePagingPage( + resourceGroupName: string, + searchServiceName: string, + options?: NetworkSecurityPerimeterConfigurationsListByServiceOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: NetworkSecurityPerimeterConfigurationsListByServiceResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByService( + resourceGroupName, + searchServiceName, + options, + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByServiceNext( + resourceGroupName, + searchServiceName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByServicePagingAll( + resourceGroupName: string, + searchServiceName: string, + options?: NetworkSecurityPerimeterConfigurationsListByServiceOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByServicePagingPage( + resourceGroupName, + searchServiceName, + options, + )) { + yield* page; + } + } + + /** + * Gets a list of network security perimeter configurations for a search service. + * @param resourceGroupName The name of the resource group within the current subscription. You can + * obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure AI Search service associated with the specified + * resource group. + * @param options The options parameters. + */ + private _listByService( + resourceGroupName: string, + searchServiceName: string, + options?: NetworkSecurityPerimeterConfigurationsListByServiceOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, searchServiceName, options }, + listByServiceOperationSpec, + ); + } + + /** + * Gets a network security perimeter configuration. + * @param resourceGroupName The name of the resource group within the current subscription. You can + * obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure AI Search service associated with the specified + * resource group. + * @param nspConfigName The network security configuration name. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + searchServiceName: string, + nspConfigName: string, + options?: NetworkSecurityPerimeterConfigurationsGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, searchServiceName, nspConfigName, options }, + getOperationSpec, + ); + } + + /** + * Reconcile network security perimeter configuration for the Azure AI Search resource provider. This + * triggers a manual resync with network security perimeter configurations by ensuring the search + * service carries the latest configuration. + * @param resourceGroupName The name of the resource group within the current subscription. You can + * obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure AI Search service associated with the specified + * resource group. + * @param nspConfigName The network security configuration name. + * @param options The options parameters. + */ + async beginReconcile( + resourceGroupName: string, + searchServiceName: string, + nspConfigName: string, + options?: NetworkSecurityPerimeterConfigurationsReconcileOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + NetworkSecurityPerimeterConfigurationsReconcileResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, searchServiceName, nspConfigName, options }, + spec: reconcileOperationSpec, + }); + const poller = await createHttpPoller< + NetworkSecurityPerimeterConfigurationsReconcileResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Reconcile network security perimeter configuration for the Azure AI Search resource provider. This + * triggers a manual resync with network security perimeter configurations by ensuring the search + * service carries the latest configuration. + * @param resourceGroupName The name of the resource group within the current subscription. You can + * obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure AI Search service associated with the specified + * resource group. + * @param nspConfigName The network security configuration name. + * @param options The options parameters. + */ + async beginReconcileAndWait( + resourceGroupName: string, + searchServiceName: string, + nspConfigName: string, + options?: NetworkSecurityPerimeterConfigurationsReconcileOptionalParams, + ): Promise { + const poller = await this.beginReconcile( + resourceGroupName, + searchServiceName, + nspConfigName, + options, + ); + return poller.pollUntilDone(); + } + + /** + * ListByServiceNext + * @param resourceGroupName The name of the resource group within the current subscription. You can + * obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure AI Search service associated with the specified + * resource group. + * @param nextLink The nextLink from the previous successful call to the ListByService method. + * @param options The options parameters. + */ + private _listByServiceNext( + resourceGroupName: string, + searchServiceName: string, + nextLink: string, + options?: NetworkSecurityPerimeterConfigurationsListByServiceNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, searchServiceName, nextLink, options }, + listByServiceNextOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByServiceOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/networkSecurityPerimeterConfigurations", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.NetworkSecurityPerimeterConfigurationListResult, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.searchServiceName, + Parameters.subscriptionId, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/networkSecurityPerimeterConfigurations/{nspConfigName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.NetworkSecurityPerimeterConfiguration, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.searchServiceName, + Parameters.subscriptionId, + Parameters.nspConfigName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const reconcileOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/networkSecurityPerimeterConfigurations/{nspConfigName}/reconcile", + httpMethod: "POST", + responses: { + 200: { + headersMapper: + Mappers.NetworkSecurityPerimeterConfigurationsReconcileHeaders, + }, + 201: { + headersMapper: + Mappers.NetworkSecurityPerimeterConfigurationsReconcileHeaders, + }, + 202: { + headersMapper: + Mappers.NetworkSecurityPerimeterConfigurationsReconcileHeaders, + }, + 204: { + headersMapper: + Mappers.NetworkSecurityPerimeterConfigurationsReconcileHeaders, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.searchServiceName, + Parameters.subscriptionId, + Parameters.nspConfigName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByServiceNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.NetworkSecurityPerimeterConfigurationListResult, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.searchServiceName, + Parameters.subscriptionId, + Parameters.nextLink, + ], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/search/arm-search/src/operations/operations.ts b/sdk/search/arm-search/src/operations/operations.ts index 97a24c9dc8f7..6db09f807116 100644 --- a/sdk/search/arm-search/src/operations/operations.ts +++ b/sdk/search/arm-search/src/operations/operations.ts @@ -15,7 +15,7 @@ import { SearchManagementClient } from "../searchManagementClient"; import { Operation, OperationsListOptionalParams, - OperationsListResponse + OperationsListResponse, } from "../models"; /// @@ -36,7 +36,7 @@ export class OperationsImpl implements Operations { * @param options The options parameters. */ public list( - options?: OperationsListOptionalParams + options?: OperationsListOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listPagingAll(options); return { @@ -51,13 +51,13 @@ export class OperationsImpl implements Operations { throw new Error("maxPageSize is not supported by this operation."); } return this.listPagingPage(options, settings); - } + }, }; } private async *listPagingPage( options?: OperationsListOptionalParams, - _settings?: PageSettings + _settings?: PageSettings, ): AsyncIterableIterator { let result: OperationsListResponse; result = await this._list(options); @@ -65,7 +65,7 @@ export class OperationsImpl implements Operations { } private async *listPagingAll( - options?: OperationsListOptionalParams + options?: OperationsListOptionalParams, ): AsyncIterableIterator { for await (const page of this.listPagingPage(options)) { yield* page; @@ -77,7 +77,7 @@ export class OperationsImpl implements Operations { * @param options The options parameters. */ private _list( - options?: OperationsListOptionalParams + options?: OperationsListOptionalParams, ): Promise { return this.client.sendOperationRequest({ options }, listOperationSpec); } @@ -90,14 +90,14 @@ const listOperationSpec: coreClient.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.OperationListResult + bodyMapper: Mappers.OperationListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/search/arm-search/src/operations/privateEndpointConnections.ts b/sdk/search/arm-search/src/operations/privateEndpointConnections.ts index 0763faabb0f6..0455cc061eac 100644 --- a/sdk/search/arm-search/src/operations/privateEndpointConnections.ts +++ b/sdk/search/arm-search/src/operations/privateEndpointConnections.ts @@ -24,13 +24,14 @@ import { PrivateEndpointConnectionsGetResponse, PrivateEndpointConnectionsDeleteOptionalParams, PrivateEndpointConnectionsDeleteResponse, - PrivateEndpointConnectionsListByServiceNextResponse + PrivateEndpointConnectionsListByServiceNextResponse, } from "../models"; /// /** Class containing PrivateEndpointConnections operations. */ export class PrivateEndpointConnectionsImpl - implements PrivateEndpointConnections { + implements PrivateEndpointConnections +{ private readonly client: SearchManagementClient; /** @@ -45,19 +46,19 @@ export class PrivateEndpointConnectionsImpl * Gets a list of all private endpoint connections in the given service. * @param resourceGroupName The name of the resource group within the current subscription. You can * obtain this value from the Azure Resource Manager API or the portal. - * @param searchServiceName The name of the Azure Cognitive Search service associated with the - * specified resource group. + * @param searchServiceName The name of the Azure AI Search service associated with the specified + * resource group. * @param options The options parameters. */ public listByService( resourceGroupName: string, searchServiceName: string, - options?: PrivateEndpointConnectionsListByServiceOptionalParams + options?: PrivateEndpointConnectionsListByServiceOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listByServicePagingAll( resourceGroupName, searchServiceName, - options + options, ); return { next() { @@ -74,9 +75,9 @@ export class PrivateEndpointConnectionsImpl resourceGroupName, searchServiceName, options, - settings + settings, ); - } + }, }; } @@ -84,7 +85,7 @@ export class PrivateEndpointConnectionsImpl resourceGroupName: string, searchServiceName: string, options?: PrivateEndpointConnectionsListByServiceOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: PrivateEndpointConnectionsListByServiceResponse; let continuationToken = settings?.continuationToken; @@ -92,7 +93,7 @@ export class PrivateEndpointConnectionsImpl result = await this._listByService( resourceGroupName, searchServiceName, - options + options, ); let page = result.value || []; continuationToken = result.nextLink; @@ -104,7 +105,7 @@ export class PrivateEndpointConnectionsImpl resourceGroupName, searchServiceName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -116,25 +117,25 @@ export class PrivateEndpointConnectionsImpl private async *listByServicePagingAll( resourceGroupName: string, searchServiceName: string, - options?: PrivateEndpointConnectionsListByServiceOptionalParams + options?: PrivateEndpointConnectionsListByServiceOptionalParams, ): AsyncIterableIterator { for await (const page of this.listByServicePagingPage( resourceGroupName, searchServiceName, - options + options, )) { yield* page; } } /** - * Updates a Private Endpoint connection to the search service in the given resource group. + * Updates a private endpoint connection to the search service in the given resource group. * @param resourceGroupName The name of the resource group within the current subscription. You can * obtain this value from the Azure Resource Manager API or the portal. - * @param searchServiceName The name of the Azure Cognitive Search service associated with the - * specified resource group. - * @param privateEndpointConnectionName The name of the private endpoint connection to the Azure - * Cognitive Search service with the specified resource group. + * @param searchServiceName The name of the Azure AI Search service associated with the specified + * resource group. + * @param privateEndpointConnectionName The name of the private endpoint connection to the Azure AI + * Search service with the specified resource group. * @param privateEndpointConnection The definition of the private endpoint connection to update. * @param options The options parameters. */ @@ -143,7 +144,7 @@ export class PrivateEndpointConnectionsImpl searchServiceName: string, privateEndpointConnectionName: string, privateEndpointConnection: PrivateEndpointConnection, - options?: PrivateEndpointConnectionsUpdateOptionalParams + options?: PrivateEndpointConnectionsUpdateOptionalParams, ): Promise { return this.client.sendOperationRequest( { @@ -151,9 +152,9 @@ export class PrivateEndpointConnectionsImpl searchServiceName, privateEndpointConnectionName, privateEndpointConnection, - options + options, }, - updateOperationSpec + updateOperationSpec, ); } @@ -162,26 +163,26 @@ export class PrivateEndpointConnectionsImpl * group. * @param resourceGroupName The name of the resource group within the current subscription. You can * obtain this value from the Azure Resource Manager API or the portal. - * @param searchServiceName The name of the Azure Cognitive Search service associated with the - * specified resource group. - * @param privateEndpointConnectionName The name of the private endpoint connection to the Azure - * Cognitive Search service with the specified resource group. + * @param searchServiceName The name of the Azure AI Search service associated with the specified + * resource group. + * @param privateEndpointConnectionName The name of the private endpoint connection to the Azure AI + * Search service with the specified resource group. * @param options The options parameters. */ get( resourceGroupName: string, searchServiceName: string, privateEndpointConnectionName: string, - options?: PrivateEndpointConnectionsGetOptionalParams + options?: PrivateEndpointConnectionsGetOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, searchServiceName, privateEndpointConnectionName, - options + options, }, - getOperationSpec + getOperationSpec, ); } @@ -189,26 +190,26 @@ export class PrivateEndpointConnectionsImpl * Disconnects the private endpoint connection and deletes it from the search service. * @param resourceGroupName The name of the resource group within the current subscription. You can * obtain this value from the Azure Resource Manager API or the portal. - * @param searchServiceName The name of the Azure Cognitive Search service associated with the - * specified resource group. - * @param privateEndpointConnectionName The name of the private endpoint connection to the Azure - * Cognitive Search service with the specified resource group. + * @param searchServiceName The name of the Azure AI Search service associated with the specified + * resource group. + * @param privateEndpointConnectionName The name of the private endpoint connection to the Azure AI + * Search service with the specified resource group. * @param options The options parameters. */ delete( resourceGroupName: string, searchServiceName: string, privateEndpointConnectionName: string, - options?: PrivateEndpointConnectionsDeleteOptionalParams + options?: PrivateEndpointConnectionsDeleteOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, searchServiceName, privateEndpointConnectionName, - options + options, }, - deleteOperationSpec + deleteOperationSpec, ); } @@ -216,18 +217,18 @@ export class PrivateEndpointConnectionsImpl * Gets a list of all private endpoint connections in the given service. * @param resourceGroupName The name of the resource group within the current subscription. You can * obtain this value from the Azure Resource Manager API or the portal. - * @param searchServiceName The name of the Azure Cognitive Search service associated with the - * specified resource group. + * @param searchServiceName The name of the Azure AI Search service associated with the specified + * resource group. * @param options The options parameters. */ private _listByService( resourceGroupName: string, searchServiceName: string, - options?: PrivateEndpointConnectionsListByServiceOptionalParams + options?: PrivateEndpointConnectionsListByServiceOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, searchServiceName, options }, - listByServiceOperationSpec + listByServiceOperationSpec, ); } @@ -235,8 +236,8 @@ export class PrivateEndpointConnectionsImpl * ListByServiceNext * @param resourceGroupName The name of the resource group within the current subscription. You can * obtain this value from the Azure Resource Manager API or the portal. - * @param searchServiceName The name of the Azure Cognitive Search service associated with the - * specified resource group. + * @param searchServiceName The name of the Azure AI Search service associated with the specified + * resource group. * @param nextLink The nextLink from the previous successful call to the ListByService method. * @param options The options parameters. */ @@ -244,11 +245,11 @@ export class PrivateEndpointConnectionsImpl resourceGroupName: string, searchServiceName: string, nextLink: string, - options?: PrivateEndpointConnectionsListByServiceNextOptionalParams + options?: PrivateEndpointConnectionsListByServiceNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, searchServiceName, nextLink, options }, - listByServiceNextOperationSpec + listByServiceNextOperationSpec, ); } } @@ -256,16 +257,15 @@ export class PrivateEndpointConnectionsImpl const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const updateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/privateEndpointConnections/{privateEndpointConnectionName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/privateEndpointConnections/{privateEndpointConnectionName}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.PrivateEndpointConnection + bodyMapper: Mappers.PrivateEndpointConnection, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, requestBody: Parameters.privateEndpointConnection, queryParameters: [Parameters.apiVersion], @@ -274,27 +274,26 @@ const updateOperationSpec: coreClient.OperationSpec = { Parameters.resourceGroupName, Parameters.searchServiceName, Parameters.subscriptionId, - Parameters.privateEndpointConnectionName + Parameters.privateEndpointConnectionName, ], headerParameters: [ Parameters.accept, Parameters.clientRequestId, - Parameters.contentType + Parameters.contentType, ], mediaType: "json", - serializer + serializer, }; const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/privateEndpointConnections/{privateEndpointConnectionName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/privateEndpointConnections/{privateEndpointConnectionName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PrivateEndpointConnection + bodyMapper: Mappers.PrivateEndpointConnection, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ @@ -302,23 +301,22 @@ const getOperationSpec: coreClient.OperationSpec = { Parameters.resourceGroupName, Parameters.searchServiceName, Parameters.subscriptionId, - Parameters.privateEndpointConnectionName + Parameters.privateEndpointConnectionName, ], headerParameters: [Parameters.accept, Parameters.clientRequestId], - serializer + serializer, }; const deleteOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/privateEndpointConnections/{privateEndpointConnectionName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/privateEndpointConnections/{privateEndpointConnectionName}", httpMethod: "DELETE", responses: { 200: { - bodyMapper: Mappers.PrivateEndpointConnection + bodyMapper: Mappers.PrivateEndpointConnection, }, 404: {}, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ @@ -326,51 +324,50 @@ const deleteOperationSpec: coreClient.OperationSpec = { Parameters.resourceGroupName, Parameters.searchServiceName, Parameters.subscriptionId, - Parameters.privateEndpointConnectionName + Parameters.privateEndpointConnectionName, ], headerParameters: [Parameters.accept, Parameters.clientRequestId], - serializer + serializer, }; const listByServiceOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/privateEndpointConnections", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/privateEndpointConnections", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PrivateEndpointConnectionListResult + bodyMapper: Mappers.PrivateEndpointConnectionListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, Parameters.searchServiceName, - Parameters.subscriptionId + Parameters.subscriptionId, ], headerParameters: [Parameters.accept, Parameters.clientRequestId], - serializer + serializer, }; const listByServiceNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PrivateEndpointConnectionListResult + bodyMapper: Mappers.PrivateEndpointConnectionListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, urlParameters: [ Parameters.$host, Parameters.resourceGroupName, Parameters.searchServiceName, Parameters.subscriptionId, - Parameters.nextLink + Parameters.nextLink, ], headerParameters: [Parameters.accept, Parameters.clientRequestId], - serializer + serializer, }; diff --git a/sdk/search/arm-search/src/operations/privateLinkResources.ts b/sdk/search/arm-search/src/operations/privateLinkResources.ts index ccefb51c5798..5689e546a62f 100644 --- a/sdk/search/arm-search/src/operations/privateLinkResources.ts +++ b/sdk/search/arm-search/src/operations/privateLinkResources.ts @@ -15,7 +15,7 @@ import { SearchManagementClient } from "../searchManagementClient"; import { PrivateLinkResource, PrivateLinkResourcesListSupportedOptionalParams, - PrivateLinkResourcesListSupportedResponse + PrivateLinkResourcesListSupportedResponse, } from "../models"; /// @@ -35,19 +35,19 @@ export class PrivateLinkResourcesImpl implements PrivateLinkResources { * Gets a list of all supported private link resource types for the given service. * @param resourceGroupName The name of the resource group within the current subscription. You can * obtain this value from the Azure Resource Manager API or the portal. - * @param searchServiceName The name of the Azure Cognitive Search service associated with the - * specified resource group. + * @param searchServiceName The name of the Azure AI Search service associated with the specified + * resource group. * @param options The options parameters. */ public listSupported( resourceGroupName: string, searchServiceName: string, - options?: PrivateLinkResourcesListSupportedOptionalParams + options?: PrivateLinkResourcesListSupportedOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listSupportedPagingAll( resourceGroupName, searchServiceName, - options + options, ); return { next() { @@ -64,9 +64,9 @@ export class PrivateLinkResourcesImpl implements PrivateLinkResources { resourceGroupName, searchServiceName, options, - settings + settings, ); - } + }, }; } @@ -74,13 +74,13 @@ export class PrivateLinkResourcesImpl implements PrivateLinkResources { resourceGroupName: string, searchServiceName: string, options?: PrivateLinkResourcesListSupportedOptionalParams, - _settings?: PageSettings + _settings?: PageSettings, ): AsyncIterableIterator { let result: PrivateLinkResourcesListSupportedResponse; result = await this._listSupported( resourceGroupName, searchServiceName, - options + options, ); yield result.value || []; } @@ -88,12 +88,12 @@ export class PrivateLinkResourcesImpl implements PrivateLinkResources { private async *listSupportedPagingAll( resourceGroupName: string, searchServiceName: string, - options?: PrivateLinkResourcesListSupportedOptionalParams + options?: PrivateLinkResourcesListSupportedOptionalParams, ): AsyncIterableIterator { for await (const page of this.listSupportedPagingPage( resourceGroupName, searchServiceName, - options + options, )) { yield* page; } @@ -103,18 +103,18 @@ export class PrivateLinkResourcesImpl implements PrivateLinkResources { * Gets a list of all supported private link resource types for the given service. * @param resourceGroupName The name of the resource group within the current subscription. You can * obtain this value from the Azure Resource Manager API or the portal. - * @param searchServiceName The name of the Azure Cognitive Search service associated with the - * specified resource group. + * @param searchServiceName The name of the Azure AI Search service associated with the specified + * resource group. * @param options The options parameters. */ private _listSupported( resourceGroupName: string, searchServiceName: string, - options?: PrivateLinkResourcesListSupportedOptionalParams + options?: PrivateLinkResourcesListSupportedOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, searchServiceName, options }, - listSupportedOperationSpec + listSupportedOperationSpec, ); } } @@ -122,24 +122,23 @@ export class PrivateLinkResourcesImpl implements PrivateLinkResources { const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const listSupportedOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/privateLinkResources", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/privateLinkResources", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PrivateLinkResourcesResult + bodyMapper: Mappers.PrivateLinkResourcesResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, Parameters.searchServiceName, - Parameters.subscriptionId + Parameters.subscriptionId, ], headerParameters: [Parameters.accept, Parameters.clientRequestId], - serializer + serializer, }; diff --git a/sdk/search/arm-search/src/operations/queryKeys.ts b/sdk/search/arm-search/src/operations/queryKeys.ts index 4cb29f5000db..a3cfccc41930 100644 --- a/sdk/search/arm-search/src/operations/queryKeys.ts +++ b/sdk/search/arm-search/src/operations/queryKeys.ts @@ -21,7 +21,7 @@ import { QueryKeysCreateOptionalParams, QueryKeysCreateResponse, QueryKeysDeleteOptionalParams, - QueryKeysListBySearchServiceNextResponse + QueryKeysListBySearchServiceNextResponse, } from "../models"; /// @@ -38,22 +38,22 @@ export class QueryKeysImpl implements QueryKeys { } /** - * Returns the list of query API keys for the given Azure Cognitive Search service. + * Returns the list of query API keys for the given Azure AI Search service. * @param resourceGroupName The name of the resource group within the current subscription. You can * obtain this value from the Azure Resource Manager API or the portal. - * @param searchServiceName The name of the Azure Cognitive Search service associated with the - * specified resource group. + * @param searchServiceName The name of the Azure AI Search service associated with the specified + * resource group. * @param options The options parameters. */ public listBySearchService( resourceGroupName: string, searchServiceName: string, - options?: QueryKeysListBySearchServiceOptionalParams + options?: QueryKeysListBySearchServiceOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listBySearchServicePagingAll( resourceGroupName, searchServiceName, - options + options, ); return { next() { @@ -70,9 +70,9 @@ export class QueryKeysImpl implements QueryKeys { resourceGroupName, searchServiceName, options, - settings + settings, ); - } + }, }; } @@ -80,7 +80,7 @@ export class QueryKeysImpl implements QueryKeys { resourceGroupName: string, searchServiceName: string, options?: QueryKeysListBySearchServiceOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: QueryKeysListBySearchServiceResponse; let continuationToken = settings?.continuationToken; @@ -88,7 +88,7 @@ export class QueryKeysImpl implements QueryKeys { result = await this._listBySearchService( resourceGroupName, searchServiceName, - options + options, ); let page = result.value || []; continuationToken = result.nextLink; @@ -100,7 +100,7 @@ export class QueryKeysImpl implements QueryKeys { resourceGroupName, searchServiceName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -112,12 +112,12 @@ export class QueryKeysImpl implements QueryKeys { private async *listBySearchServicePagingAll( resourceGroupName: string, searchServiceName: string, - options?: QueryKeysListBySearchServiceOptionalParams + options?: QueryKeysListBySearchServiceOptionalParams, ): AsyncIterableIterator { for await (const page of this.listBySearchServicePagingPage( resourceGroupName, searchServiceName, - options + options, )) { yield* page; } @@ -128,8 +128,8 @@ export class QueryKeysImpl implements QueryKeys { * service. * @param resourceGroupName The name of the resource group within the current subscription. You can * obtain this value from the Azure Resource Manager API or the portal. - * @param searchServiceName The name of the Azure Cognitive Search service associated with the - * specified resource group. + * @param searchServiceName The name of the Azure AI Search service associated with the specified + * resource group. * @param name The name of the new query API key. * @param options The options parameters. */ @@ -137,30 +137,30 @@ export class QueryKeysImpl implements QueryKeys { resourceGroupName: string, searchServiceName: string, name: string, - options?: QueryKeysCreateOptionalParams + options?: QueryKeysCreateOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, searchServiceName, name, options }, - createOperationSpec + createOperationSpec, ); } /** - * Returns the list of query API keys for the given Azure Cognitive Search service. + * Returns the list of query API keys for the given Azure AI Search service. * @param resourceGroupName The name of the resource group within the current subscription. You can * obtain this value from the Azure Resource Manager API or the portal. - * @param searchServiceName The name of the Azure Cognitive Search service associated with the - * specified resource group. + * @param searchServiceName The name of the Azure AI Search service associated with the specified + * resource group. * @param options The options parameters. */ private _listBySearchService( resourceGroupName: string, searchServiceName: string, - options?: QueryKeysListBySearchServiceOptionalParams + options?: QueryKeysListBySearchServiceOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, searchServiceName, options }, - listBySearchServiceOperationSpec + listBySearchServiceOperationSpec, ); } @@ -169,8 +169,8 @@ export class QueryKeysImpl implements QueryKeys { * regenerating a query key is to delete and then recreate it. * @param resourceGroupName The name of the resource group within the current subscription. You can * obtain this value from the Azure Resource Manager API or the portal. - * @param searchServiceName The name of the Azure Cognitive Search service associated with the - * specified resource group. + * @param searchServiceName The name of the Azure AI Search service associated with the specified + * resource group. * @param key The query key to be deleted. Query keys are identified by value, not by name. * @param options The options parameters. */ @@ -178,11 +178,11 @@ export class QueryKeysImpl implements QueryKeys { resourceGroupName: string, searchServiceName: string, key: string, - options?: QueryKeysDeleteOptionalParams + options?: QueryKeysDeleteOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, searchServiceName, key, options }, - deleteOperationSpec + deleteOperationSpec, ); } @@ -190,8 +190,8 @@ export class QueryKeysImpl implements QueryKeys { * ListBySearchServiceNext * @param resourceGroupName The name of the resource group within the current subscription. You can * obtain this value from the Azure Resource Manager API or the portal. - * @param searchServiceName The name of the Azure Cognitive Search service associated with the - * specified resource group. + * @param searchServiceName The name of the Azure AI Search service associated with the specified + * resource group. * @param nextLink The nextLink from the previous successful call to the ListBySearchService method. * @param options The options parameters. */ @@ -199,11 +199,11 @@ export class QueryKeysImpl implements QueryKeys { resourceGroupName: string, searchServiceName: string, nextLink: string, - options?: QueryKeysListBySearchServiceNextOptionalParams + options?: QueryKeysListBySearchServiceNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, searchServiceName, nextLink, options }, - listBySearchServiceNextOperationSpec + listBySearchServiceNextOperationSpec, ); } } @@ -211,16 +211,15 @@ export class QueryKeysImpl implements QueryKeys { const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const createOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/createQueryKey/{name}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/createQueryKey/{name}", httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.QueryKey + bodyMapper: Mappers.QueryKey, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ @@ -228,44 +227,42 @@ const createOperationSpec: coreClient.OperationSpec = { Parameters.resourceGroupName, Parameters.searchServiceName, Parameters.subscriptionId, - Parameters.name + Parameters.name, ], headerParameters: [Parameters.accept, Parameters.clientRequestId], - serializer + serializer, }; const listBySearchServiceOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/listQueryKeys", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/listQueryKeys", httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.ListQueryKeysResult + bodyMapper: Mappers.ListQueryKeysResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, Parameters.searchServiceName, - Parameters.subscriptionId + Parameters.subscriptionId, ], headerParameters: [Parameters.accept, Parameters.clientRequestId], - serializer + serializer, }; const deleteOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/deleteQueryKey/{key}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/deleteQueryKey/{key}", httpMethod: "DELETE", responses: { 200: {}, 204: {}, 404: {}, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ @@ -273,29 +270,29 @@ const deleteOperationSpec: coreClient.OperationSpec = { Parameters.resourceGroupName, Parameters.searchServiceName, Parameters.subscriptionId, - Parameters.key + Parameters.key, ], headerParameters: [Parameters.accept, Parameters.clientRequestId], - serializer + serializer, }; const listBySearchServiceNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ListQueryKeysResult + bodyMapper: Mappers.ListQueryKeysResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, urlParameters: [ Parameters.$host, Parameters.resourceGroupName, Parameters.searchServiceName, Parameters.subscriptionId, - Parameters.nextLink + Parameters.nextLink, ], headerParameters: [Parameters.accept, Parameters.clientRequestId], - serializer + serializer, }; diff --git a/sdk/search/arm-search/src/operations/services.ts b/sdk/search/arm-search/src/operations/services.ts index 393aa8a5e9b9..2aa2a4474b3e 100644 --- a/sdk/search/arm-search/src/operations/services.ts +++ b/sdk/search/arm-search/src/operations/services.ts @@ -16,7 +16,7 @@ import { SearchManagementClient } from "../searchManagementClient"; import { SimplePollerLike, OperationState, - createHttpPoller + createHttpPoller, } from "@azure/core-lro"; import { createLroSpec } from "../lroImpl"; import { @@ -38,7 +38,7 @@ import { ServicesCheckNameAvailabilityOptionalParams, ServicesCheckNameAvailabilityResponse, ServicesListByResourceGroupNextResponse, - ServicesListBySubscriptionNextResponse + ServicesListBySubscriptionNextResponse, } from "../models"; /// @@ -62,7 +62,7 @@ export class ServicesImpl implements Services { */ public listByResourceGroup( resourceGroupName: string, - options?: ServicesListByResourceGroupOptionalParams + options?: ServicesListByResourceGroupOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); return { @@ -79,16 +79,16 @@ export class ServicesImpl implements Services { return this.listByResourceGroupPagingPage( resourceGroupName, options, - settings + settings, ); - } + }, }; } private async *listByResourceGroupPagingPage( resourceGroupName: string, options?: ServicesListByResourceGroupOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: ServicesListByResourceGroupResponse; let continuationToken = settings?.continuationToken; @@ -103,7 +103,7 @@ export class ServicesImpl implements Services { result = await this._listByResourceGroupNext( resourceGroupName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -114,11 +114,11 @@ export class ServicesImpl implements Services { private async *listByResourceGroupPagingAll( resourceGroupName: string, - options?: ServicesListByResourceGroupOptionalParams + options?: ServicesListByResourceGroupOptionalParams, ): AsyncIterableIterator { for await (const page of this.listByResourceGroupPagingPage( resourceGroupName, - options + options, )) { yield* page; } @@ -129,7 +129,7 @@ export class ServicesImpl implements Services { * @param options The options parameters. */ public listBySubscription( - options?: ServicesListBySubscriptionOptionalParams + options?: ServicesListBySubscriptionOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listBySubscriptionPagingAll(options); return { @@ -144,13 +144,13 @@ export class ServicesImpl implements Services { throw new Error("maxPageSize is not supported by this operation."); } return this.listBySubscriptionPagingPage(options, settings); - } + }, }; } private async *listBySubscriptionPagingPage( options?: ServicesListBySubscriptionOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: ServicesListBySubscriptionResponse; let continuationToken = settings?.continuationToken; @@ -171,7 +171,7 @@ export class ServicesImpl implements Services { } private async *listBySubscriptionPagingAll( - options?: ServicesListBySubscriptionOptionalParams + options?: ServicesListBySubscriptionOptionalParams, ): AsyncIterableIterator { for await (const page of this.listBySubscriptionPagingPage(options)) { yield* page; @@ -183,12 +183,12 @@ export class ServicesImpl implements Services { * exists, all properties will be updated with the given values. * @param resourceGroupName The name of the resource group within the current subscription. You can * obtain this value from the Azure Resource Manager API or the portal. - * @param searchServiceName The name of the Azure Cognitive Search service to create or update. Search - * service names must only contain lowercase letters, digits or dashes, cannot use dash as the first - * two or last one characters, cannot contain consecutive dashes, and must be between 2 and 60 - * characters in length. Search service names must be globally unique since they are part of the - * service URI (https://.search.windows.net). You cannot change the service name after the - * service is created. + * @param searchServiceName The name of the Azure AI Search service to create or update. Search service + * names must only contain lowercase letters, digits or dashes, cannot use dash as the first two or + * last one characters, cannot contain consecutive dashes, and must be between 2 and 60 characters in + * length. Search service names must be globally unique since they are part of the service URI + * (https://.search.windows.net). You cannot change the service name after the service is + * created. * @param service The definition of the search service to create or update. * @param options The options parameters. */ @@ -196,7 +196,7 @@ export class ServicesImpl implements Services { resourceGroupName: string, searchServiceName: string, service: SearchService, - options?: ServicesCreateOrUpdateOptionalParams + options?: ServicesCreateOrUpdateOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -205,21 +205,20 @@ export class ServicesImpl implements Services { > { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -228,8 +227,8 @@ export class ServicesImpl implements Services { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -237,22 +236,22 @@ export class ServicesImpl implements Services { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; const lro = createLroSpec({ sendOperationFn, args: { resourceGroupName, searchServiceName, service, options }, - spec: createOrUpdateOperationSpec + spec: createOrUpdateOperationSpec, }); const poller = await createHttpPoller< ServicesCreateOrUpdateResponse, OperationState >(lro, { restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + intervalInMs: options?.updateIntervalInMs, }); await poller.poll(); return poller; @@ -263,12 +262,12 @@ export class ServicesImpl implements Services { * exists, all properties will be updated with the given values. * @param resourceGroupName The name of the resource group within the current subscription. You can * obtain this value from the Azure Resource Manager API or the portal. - * @param searchServiceName The name of the Azure Cognitive Search service to create or update. Search - * service names must only contain lowercase letters, digits or dashes, cannot use dash as the first - * two or last one characters, cannot contain consecutive dashes, and must be between 2 and 60 - * characters in length. Search service names must be globally unique since they are part of the - * service URI (https://.search.windows.net). You cannot change the service name after the - * service is created. + * @param searchServiceName The name of the Azure AI Search service to create or update. Search service + * names must only contain lowercase letters, digits or dashes, cannot use dash as the first two or + * last one characters, cannot contain consecutive dashes, and must be between 2 and 60 characters in + * length. Search service names must be globally unique since they are part of the service URI + * (https://.search.windows.net). You cannot change the service name after the service is + * created. * @param service The definition of the search service to create or update. * @param options The options parameters. */ @@ -276,13 +275,13 @@ export class ServicesImpl implements Services { resourceGroupName: string, searchServiceName: string, service: SearchService, - options?: ServicesCreateOrUpdateOptionalParams + options?: ServicesCreateOrUpdateOptionalParams, ): Promise { const poller = await this.beginCreateOrUpdate( resourceGroupName, searchServiceName, service, - options + options, ); return poller.pollUntilDone(); } @@ -291,7 +290,7 @@ export class ServicesImpl implements Services { * Updates an existing search service in the given resource group. * @param resourceGroupName The name of the resource group within the current subscription. You can * obtain this value from the Azure Resource Manager API or the portal. - * @param searchServiceName The name of the Azure Cognitive Search service to update. + * @param searchServiceName The name of the Azure AI Search service to update. * @param service The definition of the search service to update. * @param options The options parameters. */ @@ -299,11 +298,11 @@ export class ServicesImpl implements Services { resourceGroupName: string, searchServiceName: string, service: SearchServiceUpdate, - options?: ServicesUpdateOptionalParams + options?: ServicesUpdateOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, searchServiceName, service, options }, - updateOperationSpec + updateOperationSpec, ); } @@ -311,18 +310,18 @@ export class ServicesImpl implements Services { * Gets the search service with the given name in the given resource group. * @param resourceGroupName The name of the resource group within the current subscription. You can * obtain this value from the Azure Resource Manager API or the portal. - * @param searchServiceName The name of the Azure Cognitive Search service associated with the - * specified resource group. + * @param searchServiceName The name of the Azure AI Search service associated with the specified + * resource group. * @param options The options parameters. */ get( resourceGroupName: string, searchServiceName: string, - options?: ServicesGetOptionalParams + options?: ServicesGetOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, searchServiceName, options }, - getOperationSpec + getOperationSpec, ); } @@ -330,18 +329,18 @@ export class ServicesImpl implements Services { * Deletes a search service in the given resource group, along with its associated resources. * @param resourceGroupName The name of the resource group within the current subscription. You can * obtain this value from the Azure Resource Manager API or the portal. - * @param searchServiceName The name of the Azure Cognitive Search service associated with the - * specified resource group. + * @param searchServiceName The name of the Azure AI Search service associated with the specified + * resource group. * @param options The options parameters. */ delete( resourceGroupName: string, searchServiceName: string, - options?: ServicesDeleteOptionalParams + options?: ServicesDeleteOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, searchServiceName, options }, - deleteOperationSpec + deleteOperationSpec, ); } @@ -353,11 +352,11 @@ export class ServicesImpl implements Services { */ private _listByResourceGroup( resourceGroupName: string, - options?: ServicesListByResourceGroupOptionalParams + options?: ServicesListByResourceGroupOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, options }, - listByResourceGroupOperationSpec + listByResourceGroupOperationSpec, ); } @@ -366,11 +365,11 @@ export class ServicesImpl implements Services { * @param options The options parameters. */ private _listBySubscription( - options?: ServicesListBySubscriptionOptionalParams + options?: ServicesListBySubscriptionOptionalParams, ): Promise { return this.client.sendOperationRequest( { options }, - listBySubscriptionOperationSpec + listBySubscriptionOperationSpec, ); } @@ -384,11 +383,11 @@ export class ServicesImpl implements Services { */ checkNameAvailability( name: string, - options?: ServicesCheckNameAvailabilityOptionalParams + options?: ServicesCheckNameAvailabilityOptionalParams, ): Promise { return this.client.sendOperationRequest( { name, options }, - checkNameAvailabilityOperationSpec + checkNameAvailabilityOperationSpec, ); } @@ -402,11 +401,11 @@ export class ServicesImpl implements Services { private _listByResourceGroupNext( resourceGroupName: string, nextLink: string, - options?: ServicesListByResourceGroupNextOptionalParams + options?: ServicesListByResourceGroupNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, nextLink, options }, - listByResourceGroupNextOperationSpec + listByResourceGroupNextOperationSpec, ); } @@ -417,11 +416,11 @@ export class ServicesImpl implements Services { */ private _listBySubscriptionNext( nextLink: string, - options?: ServicesListBySubscriptionNextOptionalParams + options?: ServicesListBySubscriptionNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { nextLink, options }, - listBySubscriptionNextOperationSpec + listBySubscriptionNextOperationSpec, ); } } @@ -429,214 +428,207 @@ export class ServicesImpl implements Services { const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.SearchService + bodyMapper: Mappers.SearchService, }, 201: { - bodyMapper: Mappers.SearchService + bodyMapper: Mappers.SearchService, }, 202: { - bodyMapper: Mappers.SearchService + bodyMapper: Mappers.SearchService, }, 204: { - bodyMapper: Mappers.SearchService + bodyMapper: Mappers.SearchService, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, requestBody: Parameters.service, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, - Parameters.searchServiceName, - Parameters.subscriptionId + Parameters.subscriptionId, + Parameters.searchServiceName1, ], headerParameters: [ Parameters.accept, Parameters.clientRequestId, - Parameters.contentType + Parameters.contentType, ], mediaType: "json", - serializer + serializer, }; const updateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}", httpMethod: "PATCH", responses: { 200: { - bodyMapper: Mappers.SearchService + bodyMapper: Mappers.SearchService, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, requestBody: Parameters.service1, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, - Parameters.searchServiceName, - Parameters.subscriptionId + Parameters.subscriptionId, + Parameters.searchServiceName1, ], headerParameters: [ Parameters.accept, Parameters.clientRequestId, - Parameters.contentType + Parameters.contentType, ], mediaType: "json", - serializer + serializer, }; const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.SearchService + bodyMapper: Mappers.SearchService, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, Parameters.searchServiceName, - Parameters.subscriptionId + Parameters.subscriptionId, ], headerParameters: [Parameters.accept, Parameters.clientRequestId], - serializer + serializer, }; const deleteOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}", httpMethod: "DELETE", responses: { 200: {}, 204: {}, 404: {}, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, Parameters.searchServiceName, - Parameters.subscriptionId + Parameters.subscriptionId, ], headerParameters: [Parameters.accept, Parameters.clientRequestId], - serializer + serializer, }; const listByResourceGroupOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.SearchServiceListResult + bodyMapper: Mappers.SearchServiceListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, - Parameters.subscriptionId + Parameters.subscriptionId, ], headerParameters: [Parameters.accept, Parameters.clientRequestId], - serializer + serializer, }; const listBySubscriptionOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Search/searchServices", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Search/searchServices", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.SearchServiceListResult + bodyMapper: Mappers.SearchServiceListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept, Parameters.clientRequestId], - serializer + serializer, }; const checkNameAvailabilityOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Search/checkNameAvailability", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Search/checkNameAvailability", httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.CheckNameAvailabilityOutput + bodyMapper: Mappers.CheckNameAvailabilityOutput, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, requestBody: { parameterPath: { name: ["name"], typeParam: ["typeParam"] }, - mapper: { ...Mappers.CheckNameAvailabilityInput, required: true } + mapper: { ...Mappers.CheckNameAvailabilityInput, required: true }, }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [ Parameters.accept, Parameters.clientRequestId, - Parameters.contentType + Parameters.contentType, ], mediaType: "json", - serializer + serializer, }; const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.SearchServiceListResult + bodyMapper: Mappers.SearchServiceListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, urlParameters: [ Parameters.$host, Parameters.resourceGroupName, Parameters.subscriptionId, - Parameters.nextLink + Parameters.nextLink, ], headerParameters: [Parameters.accept, Parameters.clientRequestId], - serializer + serializer, }; const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.SearchServiceListResult + bodyMapper: Mappers.SearchServiceListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.nextLink + Parameters.nextLink, ], headerParameters: [Parameters.accept, Parameters.clientRequestId], - serializer + serializer, }; diff --git a/sdk/search/arm-search/src/operations/sharedPrivateLinkResources.ts b/sdk/search/arm-search/src/operations/sharedPrivateLinkResources.ts index 68fcb6ae4998..d83d37f9c188 100644 --- a/sdk/search/arm-search/src/operations/sharedPrivateLinkResources.ts +++ b/sdk/search/arm-search/src/operations/sharedPrivateLinkResources.ts @@ -16,7 +16,7 @@ import { SearchManagementClient } from "../searchManagementClient"; import { SimplePollerLike, OperationState, - createHttpPoller + createHttpPoller, } from "@azure/core-lro"; import { createLroSpec } from "../lroImpl"; import { @@ -29,13 +29,14 @@ import { SharedPrivateLinkResourcesGetOptionalParams, SharedPrivateLinkResourcesGetResponse, SharedPrivateLinkResourcesDeleteOptionalParams, - SharedPrivateLinkResourcesListByServiceNextResponse + SharedPrivateLinkResourcesListByServiceNextResponse, } from "../models"; /// /** Class containing SharedPrivateLinkResources operations. */ export class SharedPrivateLinkResourcesImpl - implements SharedPrivateLinkResources { + implements SharedPrivateLinkResources +{ private readonly client: SearchManagementClient; /** @@ -50,19 +51,19 @@ export class SharedPrivateLinkResourcesImpl * Gets a list of all shared private link resources managed by the given service. * @param resourceGroupName The name of the resource group within the current subscription. You can * obtain this value from the Azure Resource Manager API or the portal. - * @param searchServiceName The name of the Azure Cognitive Search service associated with the - * specified resource group. + * @param searchServiceName The name of the Azure AI Search service associated with the specified + * resource group. * @param options The options parameters. */ public listByService( resourceGroupName: string, searchServiceName: string, - options?: SharedPrivateLinkResourcesListByServiceOptionalParams + options?: SharedPrivateLinkResourcesListByServiceOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listByServicePagingAll( resourceGroupName, searchServiceName, - options + options, ); return { next() { @@ -79,9 +80,9 @@ export class SharedPrivateLinkResourcesImpl resourceGroupName, searchServiceName, options, - settings + settings, ); - } + }, }; } @@ -89,7 +90,7 @@ export class SharedPrivateLinkResourcesImpl resourceGroupName: string, searchServiceName: string, options?: SharedPrivateLinkResourcesListByServiceOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: SharedPrivateLinkResourcesListByServiceResponse; let continuationToken = settings?.continuationToken; @@ -97,7 +98,7 @@ export class SharedPrivateLinkResourcesImpl result = await this._listByService( resourceGroupName, searchServiceName, - options + options, ); let page = result.value || []; continuationToken = result.nextLink; @@ -109,7 +110,7 @@ export class SharedPrivateLinkResourcesImpl resourceGroupName, searchServiceName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -121,12 +122,12 @@ export class SharedPrivateLinkResourcesImpl private async *listByServicePagingAll( resourceGroupName: string, searchServiceName: string, - options?: SharedPrivateLinkResourcesListByServiceOptionalParams + options?: SharedPrivateLinkResourcesListByServiceOptionalParams, ): AsyncIterableIterator { for await (const page of this.listByServicePagingPage( resourceGroupName, searchServiceName, - options + options, )) { yield* page; } @@ -137,10 +138,10 @@ export class SharedPrivateLinkResourcesImpl * the given resource group. * @param resourceGroupName The name of the resource group within the current subscription. You can * obtain this value from the Azure Resource Manager API or the portal. - * @param searchServiceName The name of the Azure Cognitive Search service associated with the - * specified resource group. + * @param searchServiceName The name of the Azure AI Search service associated with the specified + * resource group. * @param sharedPrivateLinkResourceName The name of the shared private link resource managed by the - * Azure Cognitive Search service within the specified resource group. + * Azure AI Search service within the specified resource group. * @param sharedPrivateLinkResource The definition of the shared private link resource to create or * update. * @param options The options parameters. @@ -150,7 +151,7 @@ export class SharedPrivateLinkResourcesImpl searchServiceName: string, sharedPrivateLinkResourceName: string, sharedPrivateLinkResource: SharedPrivateLinkResource, - options?: SharedPrivateLinkResourcesCreateOrUpdateOptionalParams + options?: SharedPrivateLinkResourcesCreateOrUpdateOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -159,21 +160,20 @@ export class SharedPrivateLinkResourcesImpl > { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -182,8 +182,8 @@ export class SharedPrivateLinkResourcesImpl ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -191,8 +191,8 @@ export class SharedPrivateLinkResourcesImpl rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; @@ -203,9 +203,9 @@ export class SharedPrivateLinkResourcesImpl searchServiceName, sharedPrivateLinkResourceName, sharedPrivateLinkResource, - options + options, }, - spec: createOrUpdateOperationSpec + spec: createOrUpdateOperationSpec, }); const poller = await createHttpPoller< SharedPrivateLinkResourcesCreateOrUpdateResponse, @@ -213,7 +213,7 @@ export class SharedPrivateLinkResourcesImpl >(lro, { restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "azure-async-operation" + resourceLocationConfig: "azure-async-operation", }); await poller.poll(); return poller; @@ -224,10 +224,10 @@ export class SharedPrivateLinkResourcesImpl * the given resource group. * @param resourceGroupName The name of the resource group within the current subscription. You can * obtain this value from the Azure Resource Manager API or the portal. - * @param searchServiceName The name of the Azure Cognitive Search service associated with the - * specified resource group. + * @param searchServiceName The name of the Azure AI Search service associated with the specified + * resource group. * @param sharedPrivateLinkResourceName The name of the shared private link resource managed by the - * Azure Cognitive Search service within the specified resource group. + * Azure AI Search service within the specified resource group. * @param sharedPrivateLinkResource The definition of the shared private link resource to create or * update. * @param options The options parameters. @@ -237,14 +237,14 @@ export class SharedPrivateLinkResourcesImpl searchServiceName: string, sharedPrivateLinkResourceName: string, sharedPrivateLinkResource: SharedPrivateLinkResource, - options?: SharedPrivateLinkResourcesCreateOrUpdateOptionalParams + options?: SharedPrivateLinkResourcesCreateOrUpdateOptionalParams, ): Promise { const poller = await this.beginCreateOrUpdate( resourceGroupName, searchServiceName, sharedPrivateLinkResourceName, sharedPrivateLinkResource, - options + options, ); return poller.pollUntilDone(); } @@ -254,26 +254,26 @@ export class SharedPrivateLinkResourcesImpl * resource group. * @param resourceGroupName The name of the resource group within the current subscription. You can * obtain this value from the Azure Resource Manager API or the portal. - * @param searchServiceName The name of the Azure Cognitive Search service associated with the - * specified resource group. + * @param searchServiceName The name of the Azure AI Search service associated with the specified + * resource group. * @param sharedPrivateLinkResourceName The name of the shared private link resource managed by the - * Azure Cognitive Search service within the specified resource group. + * Azure AI Search service within the specified resource group. * @param options The options parameters. */ get( resourceGroupName: string, searchServiceName: string, sharedPrivateLinkResourceName: string, - options?: SharedPrivateLinkResourcesGetOptionalParams + options?: SharedPrivateLinkResourcesGetOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, searchServiceName, sharedPrivateLinkResourceName, - options + options, }, - getOperationSpec + getOperationSpec, ); } @@ -281,35 +281,34 @@ export class SharedPrivateLinkResourcesImpl * Initiates the deletion of the shared private link resource from the search service. * @param resourceGroupName The name of the resource group within the current subscription. You can * obtain this value from the Azure Resource Manager API or the portal. - * @param searchServiceName The name of the Azure Cognitive Search service associated with the - * specified resource group. + * @param searchServiceName The name of the Azure AI Search service associated with the specified + * resource group. * @param sharedPrivateLinkResourceName The name of the shared private link resource managed by the - * Azure Cognitive Search service within the specified resource group. + * Azure AI Search service within the specified resource group. * @param options The options parameters. */ async beginDelete( resourceGroupName: string, searchServiceName: string, sharedPrivateLinkResourceName: string, - options?: SharedPrivateLinkResourcesDeleteOptionalParams + options?: SharedPrivateLinkResourcesDeleteOptionalParams, ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -318,8 +317,8 @@ export class SharedPrivateLinkResourcesImpl ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -327,8 +326,8 @@ export class SharedPrivateLinkResourcesImpl rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; @@ -338,14 +337,14 @@ export class SharedPrivateLinkResourcesImpl resourceGroupName, searchServiceName, sharedPrivateLinkResourceName, - options + options, }, - spec: deleteOperationSpec + spec: deleteOperationSpec, }); const poller = await createHttpPoller>(lro, { restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "azure-async-operation" + resourceLocationConfig: "azure-async-operation", }); await poller.poll(); return poller; @@ -355,23 +354,23 @@ export class SharedPrivateLinkResourcesImpl * Initiates the deletion of the shared private link resource from the search service. * @param resourceGroupName The name of the resource group within the current subscription. You can * obtain this value from the Azure Resource Manager API or the portal. - * @param searchServiceName The name of the Azure Cognitive Search service associated with the - * specified resource group. + * @param searchServiceName The name of the Azure AI Search service associated with the specified + * resource group. * @param sharedPrivateLinkResourceName The name of the shared private link resource managed by the - * Azure Cognitive Search service within the specified resource group. + * Azure AI Search service within the specified resource group. * @param options The options parameters. */ async beginDeleteAndWait( resourceGroupName: string, searchServiceName: string, sharedPrivateLinkResourceName: string, - options?: SharedPrivateLinkResourcesDeleteOptionalParams + options?: SharedPrivateLinkResourcesDeleteOptionalParams, ): Promise { const poller = await this.beginDelete( resourceGroupName, searchServiceName, sharedPrivateLinkResourceName, - options + options, ); return poller.pollUntilDone(); } @@ -380,18 +379,18 @@ export class SharedPrivateLinkResourcesImpl * Gets a list of all shared private link resources managed by the given service. * @param resourceGroupName The name of the resource group within the current subscription. You can * obtain this value from the Azure Resource Manager API or the portal. - * @param searchServiceName The name of the Azure Cognitive Search service associated with the - * specified resource group. + * @param searchServiceName The name of the Azure AI Search service associated with the specified + * resource group. * @param options The options parameters. */ private _listByService( resourceGroupName: string, searchServiceName: string, - options?: SharedPrivateLinkResourcesListByServiceOptionalParams + options?: SharedPrivateLinkResourcesListByServiceOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, searchServiceName, options }, - listByServiceOperationSpec + listByServiceOperationSpec, ); } @@ -399,8 +398,8 @@ export class SharedPrivateLinkResourcesImpl * ListByServiceNext * @param resourceGroupName The name of the resource group within the current subscription. You can * obtain this value from the Azure Resource Manager API or the portal. - * @param searchServiceName The name of the Azure Cognitive Search service associated with the - * specified resource group. + * @param searchServiceName The name of the Azure AI Search service associated with the specified + * resource group. * @param nextLink The nextLink from the previous successful call to the ListByService method. * @param options The options parameters. */ @@ -408,11 +407,11 @@ export class SharedPrivateLinkResourcesImpl resourceGroupName: string, searchServiceName: string, nextLink: string, - options?: SharedPrivateLinkResourcesListByServiceNextOptionalParams + options?: SharedPrivateLinkResourcesListByServiceNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, searchServiceName, nextLink, options }, - listByServiceNextOperationSpec + listByServiceNextOperationSpec, ); } } @@ -420,25 +419,24 @@ export class SharedPrivateLinkResourcesImpl const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.SharedPrivateLinkResource + bodyMapper: Mappers.SharedPrivateLinkResource, }, 201: { - bodyMapper: Mappers.SharedPrivateLinkResource + bodyMapper: Mappers.SharedPrivateLinkResource, }, 202: { - bodyMapper: Mappers.SharedPrivateLinkResource + bodyMapper: Mappers.SharedPrivateLinkResource, }, 204: { - bodyMapper: Mappers.SharedPrivateLinkResource + bodyMapper: Mappers.SharedPrivateLinkResource, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, requestBody: Parameters.sharedPrivateLinkResource, queryParameters: [Parameters.apiVersion], @@ -447,27 +445,26 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { Parameters.resourceGroupName, Parameters.searchServiceName, Parameters.subscriptionId, - Parameters.sharedPrivateLinkResourceName + Parameters.sharedPrivateLinkResourceName, ], headerParameters: [ Parameters.accept, Parameters.clientRequestId, - Parameters.contentType + Parameters.contentType, ], mediaType: "json", - serializer + serializer, }; const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.SharedPrivateLinkResource + bodyMapper: Mappers.SharedPrivateLinkResource, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ @@ -475,14 +472,13 @@ const getOperationSpec: coreClient.OperationSpec = { Parameters.resourceGroupName, Parameters.searchServiceName, Parameters.subscriptionId, - Parameters.sharedPrivateLinkResourceName + Parameters.sharedPrivateLinkResourceName, ], headerParameters: [Parameters.accept, Parameters.clientRequestId], - serializer + serializer, }; const deleteOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName}", httpMethod: "DELETE", responses: { 200: {}, @@ -490,8 +486,8 @@ const deleteOperationSpec: coreClient.OperationSpec = { 202: {}, 204: {}, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ @@ -499,51 +495,50 @@ const deleteOperationSpec: coreClient.OperationSpec = { Parameters.resourceGroupName, Parameters.searchServiceName, Parameters.subscriptionId, - Parameters.sharedPrivateLinkResourceName + Parameters.sharedPrivateLinkResourceName, ], headerParameters: [Parameters.accept, Parameters.clientRequestId], - serializer + serializer, }; const listByServiceOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/sharedPrivateLinkResources", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/sharedPrivateLinkResources", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.SharedPrivateLinkResourceListResult + bodyMapper: Mappers.SharedPrivateLinkResourceListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, Parameters.searchServiceName, - Parameters.subscriptionId + Parameters.subscriptionId, ], headerParameters: [Parameters.accept, Parameters.clientRequestId], - serializer + serializer, }; const listByServiceNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.SharedPrivateLinkResourceListResult + bodyMapper: Mappers.SharedPrivateLinkResourceListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, urlParameters: [ Parameters.$host, Parameters.resourceGroupName, Parameters.searchServiceName, Parameters.subscriptionId, - Parameters.nextLink + Parameters.nextLink, ], headerParameters: [Parameters.accept, Parameters.clientRequestId], - serializer + serializer, }; diff --git a/sdk/search/arm-search/src/operations/usages.ts b/sdk/search/arm-search/src/operations/usages.ts index da16917cf77c..42bbcdeea1f7 100644 --- a/sdk/search/arm-search/src/operations/usages.ts +++ b/sdk/search/arm-search/src/operations/usages.ts @@ -18,7 +18,7 @@ import { UsagesListBySubscriptionNextOptionalParams, UsagesListBySubscriptionOptionalParams, UsagesListBySubscriptionResponse, - UsagesListBySubscriptionNextResponse + UsagesListBySubscriptionNextResponse, } from "../models"; /// @@ -35,13 +35,13 @@ export class UsagesImpl implements Usages { } /** - * Gets a list of all Search quota usages in the given subscription. + * Get a list of all Azure AI Search quota usages across the subscription. * @param location The unique location name for a Microsoft Azure geographic region. * @param options The options parameters. */ public listBySubscription( location: string, - options?: UsagesListBySubscriptionOptionalParams + options?: UsagesListBySubscriptionOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listBySubscriptionPagingAll(location, options); return { @@ -56,14 +56,14 @@ export class UsagesImpl implements Usages { throw new Error("maxPageSize is not supported by this operation."); } return this.listBySubscriptionPagingPage(location, options, settings); - } + }, }; } private async *listBySubscriptionPagingPage( location: string, options?: UsagesListBySubscriptionOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: UsagesListBySubscriptionResponse; let continuationToken = settings?.continuationToken; @@ -78,7 +78,7 @@ export class UsagesImpl implements Usages { result = await this._listBySubscriptionNext( location, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -89,28 +89,28 @@ export class UsagesImpl implements Usages { private async *listBySubscriptionPagingAll( location: string, - options?: UsagesListBySubscriptionOptionalParams + options?: UsagesListBySubscriptionOptionalParams, ): AsyncIterableIterator { for await (const page of this.listBySubscriptionPagingPage( location, - options + options, )) { yield* page; } } /** - * Gets a list of all Search quota usages in the given subscription. + * Get a list of all Azure AI Search quota usages across the subscription. * @param location The unique location name for a Microsoft Azure geographic region. * @param options The options parameters. */ private _listBySubscription( location: string, - options?: UsagesListBySubscriptionOptionalParams + options?: UsagesListBySubscriptionOptionalParams, ): Promise { return this.client.sendOperationRequest( { location, options }, - listBySubscriptionOperationSpec + listBySubscriptionOperationSpec, ); } @@ -123,11 +123,11 @@ export class UsagesImpl implements Usages { private _listBySubscriptionNext( location: string, nextLink: string, - options?: UsagesListBySubscriptionNextOptionalParams + options?: UsagesListBySubscriptionNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { location, nextLink, options }, - listBySubscriptionNextOperationSpec + listBySubscriptionNextOperationSpec, ); } } @@ -135,43 +135,42 @@ export class UsagesImpl implements Usages { const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const listBySubscriptionOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Search/locations/{location}/usages", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Search/locations/{location}/usages", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.QuotaUsagesListResult + bodyMapper: Mappers.QuotaUsagesListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.location + Parameters.location, ], headerParameters: [Parameters.accept, Parameters.clientRequestId], - serializer + serializer, }; const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.QuotaUsagesListResult + bodyMapper: Mappers.QuotaUsagesListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.nextLink, - Parameters.location + Parameters.location, ], headerParameters: [Parameters.accept, Parameters.clientRequestId], - serializer + serializer, }; diff --git a/sdk/search/arm-search/src/operationsInterfaces/adminKeys.ts b/sdk/search/arm-search/src/operationsInterfaces/adminKeys.ts index d0309d912727..a5fe08a21b23 100644 --- a/sdk/search/arm-search/src/operationsInterfaces/adminKeys.ts +++ b/sdk/search/arm-search/src/operationsInterfaces/adminKeys.ts @@ -11,31 +11,31 @@ import { AdminKeysGetResponse, AdminKeyKind, AdminKeysRegenerateOptionalParams, - AdminKeysRegenerateResponse + AdminKeysRegenerateResponse, } from "../models"; /** Interface representing a AdminKeys. */ export interface AdminKeys { /** - * Gets the primary and secondary admin API keys for the specified Azure Cognitive Search service. + * Gets the primary and secondary admin API keys for the specified Azure AI Search service. * @param resourceGroupName The name of the resource group within the current subscription. You can * obtain this value from the Azure Resource Manager API or the portal. - * @param searchServiceName The name of the Azure Cognitive Search service associated with the - * specified resource group. + * @param searchServiceName The name of the Azure AI Search service associated with the specified + * resource group. * @param options The options parameters. */ get( resourceGroupName: string, searchServiceName: string, - options?: AdminKeysGetOptionalParams + options?: AdminKeysGetOptionalParams, ): Promise; /** * Regenerates either the primary or secondary admin API key. You can only regenerate one key at a * time. * @param resourceGroupName The name of the resource group within the current subscription. You can * obtain this value from the Azure Resource Manager API or the portal. - * @param searchServiceName The name of the Azure Cognitive Search service associated with the - * specified resource group. + * @param searchServiceName The name of the Azure AI Search service associated with the specified + * resource group. * @param keyKind Specifies which key to regenerate. Valid values include 'primary' and 'secondary'. * @param options The options parameters. */ @@ -43,6 +43,6 @@ export interface AdminKeys { resourceGroupName: string, searchServiceName: string, keyKind: AdminKeyKind, - options?: AdminKeysRegenerateOptionalParams + options?: AdminKeysRegenerateOptionalParams, ): Promise; } diff --git a/sdk/search/arm-search/src/operationsInterfaces/index.ts b/sdk/search/arm-search/src/operationsInterfaces/index.ts index f60f5a357ae2..e8c3c318ae97 100644 --- a/sdk/search/arm-search/src/operationsInterfaces/index.ts +++ b/sdk/search/arm-search/src/operationsInterfaces/index.ts @@ -14,3 +14,4 @@ export * from "./privateLinkResources"; export * from "./privateEndpointConnections"; export * from "./sharedPrivateLinkResources"; export * from "./usages"; +export * from "./networkSecurityPerimeterConfigurations"; diff --git a/sdk/search/arm-search/src/operationsInterfaces/networkSecurityPerimeterConfigurations.ts b/sdk/search/arm-search/src/operationsInterfaces/networkSecurityPerimeterConfigurations.ts new file mode 100644 index 000000000000..c404ae78ddff --- /dev/null +++ b/sdk/search/arm-search/src/operationsInterfaces/networkSecurityPerimeterConfigurations.ts @@ -0,0 +1,90 @@ +/* + * 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 { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + NetworkSecurityPerimeterConfiguration, + NetworkSecurityPerimeterConfigurationsListByServiceOptionalParams, + NetworkSecurityPerimeterConfigurationsGetOptionalParams, + NetworkSecurityPerimeterConfigurationsGetResponse, + NetworkSecurityPerimeterConfigurationsReconcileOptionalParams, + NetworkSecurityPerimeterConfigurationsReconcileResponse, +} from "../models"; + +/// +/** Interface representing a NetworkSecurityPerimeterConfigurations. */ +export interface NetworkSecurityPerimeterConfigurations { + /** + * Gets a list of network security perimeter configurations for a search service. + * @param resourceGroupName The name of the resource group within the current subscription. You can + * obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure AI Search service associated with the specified + * resource group. + * @param options The options parameters. + */ + listByService( + resourceGroupName: string, + searchServiceName: string, + options?: NetworkSecurityPerimeterConfigurationsListByServiceOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Gets a network security perimeter configuration. + * @param resourceGroupName The name of the resource group within the current subscription. You can + * obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure AI Search service associated with the specified + * resource group. + * @param nspConfigName The network security configuration name. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + searchServiceName: string, + nspConfigName: string, + options?: NetworkSecurityPerimeterConfigurationsGetOptionalParams, + ): Promise; + /** + * Reconcile network security perimeter configuration for the Azure AI Search resource provider. This + * triggers a manual resync with network security perimeter configurations by ensuring the search + * service carries the latest configuration. + * @param resourceGroupName The name of the resource group within the current subscription. You can + * obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure AI Search service associated with the specified + * resource group. + * @param nspConfigName The network security configuration name. + * @param options The options parameters. + */ + beginReconcile( + resourceGroupName: string, + searchServiceName: string, + nspConfigName: string, + options?: NetworkSecurityPerimeterConfigurationsReconcileOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + NetworkSecurityPerimeterConfigurationsReconcileResponse + > + >; + /** + * Reconcile network security perimeter configuration for the Azure AI Search resource provider. This + * triggers a manual resync with network security perimeter configurations by ensuring the search + * service carries the latest configuration. + * @param resourceGroupName The name of the resource group within the current subscription. You can + * obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure AI Search service associated with the specified + * resource group. + * @param nspConfigName The network security configuration name. + * @param options The options parameters. + */ + beginReconcileAndWait( + resourceGroupName: string, + searchServiceName: string, + nspConfigName: string, + options?: NetworkSecurityPerimeterConfigurationsReconcileOptionalParams, + ): Promise; +} diff --git a/sdk/search/arm-search/src/operationsInterfaces/operations.ts b/sdk/search/arm-search/src/operationsInterfaces/operations.ts index 1b035e0e851c..21813182553e 100644 --- a/sdk/search/arm-search/src/operationsInterfaces/operations.ts +++ b/sdk/search/arm-search/src/operationsInterfaces/operations.ts @@ -17,6 +17,6 @@ export interface Operations { * @param options The options parameters. */ list( - options?: OperationsListOptionalParams + options?: OperationsListOptionalParams, ): PagedAsyncIterableIterator; } diff --git a/sdk/search/arm-search/src/operationsInterfaces/privateEndpointConnections.ts b/sdk/search/arm-search/src/operationsInterfaces/privateEndpointConnections.ts index b5d44e398ab2..19528b1e2609 100644 --- a/sdk/search/arm-search/src/operationsInterfaces/privateEndpointConnections.ts +++ b/sdk/search/arm-search/src/operationsInterfaces/privateEndpointConnections.ts @@ -15,7 +15,7 @@ import { PrivateEndpointConnectionsGetOptionalParams, PrivateEndpointConnectionsGetResponse, PrivateEndpointConnectionsDeleteOptionalParams, - PrivateEndpointConnectionsDeleteResponse + PrivateEndpointConnectionsDeleteResponse, } from "../models"; /// @@ -25,23 +25,23 @@ export interface PrivateEndpointConnections { * Gets a list of all private endpoint connections in the given service. * @param resourceGroupName The name of the resource group within the current subscription. You can * obtain this value from the Azure Resource Manager API or the portal. - * @param searchServiceName The name of the Azure Cognitive Search service associated with the - * specified resource group. + * @param searchServiceName The name of the Azure AI Search service associated with the specified + * resource group. * @param options The options parameters. */ listByService( resourceGroupName: string, searchServiceName: string, - options?: PrivateEndpointConnectionsListByServiceOptionalParams + options?: PrivateEndpointConnectionsListByServiceOptionalParams, ): PagedAsyncIterableIterator; /** - * Updates a Private Endpoint connection to the search service in the given resource group. + * Updates a private endpoint connection to the search service in the given resource group. * @param resourceGroupName The name of the resource group within the current subscription. You can * obtain this value from the Azure Resource Manager API or the portal. - * @param searchServiceName The name of the Azure Cognitive Search service associated with the - * specified resource group. - * @param privateEndpointConnectionName The name of the private endpoint connection to the Azure - * Cognitive Search service with the specified resource group. + * @param searchServiceName The name of the Azure AI Search service associated with the specified + * resource group. + * @param privateEndpointConnectionName The name of the private endpoint connection to the Azure AI + * Search service with the specified resource group. * @param privateEndpointConnection The definition of the private endpoint connection to update. * @param options The options parameters. */ @@ -50,39 +50,39 @@ export interface PrivateEndpointConnections { searchServiceName: string, privateEndpointConnectionName: string, privateEndpointConnection: PrivateEndpointConnection, - options?: PrivateEndpointConnectionsUpdateOptionalParams + options?: PrivateEndpointConnectionsUpdateOptionalParams, ): Promise; /** * Gets the details of the private endpoint connection to the search service in the given resource * group. * @param resourceGroupName The name of the resource group within the current subscription. You can * obtain this value from the Azure Resource Manager API or the portal. - * @param searchServiceName The name of the Azure Cognitive Search service associated with the - * specified resource group. - * @param privateEndpointConnectionName The name of the private endpoint connection to the Azure - * Cognitive Search service with the specified resource group. + * @param searchServiceName The name of the Azure AI Search service associated with the specified + * resource group. + * @param privateEndpointConnectionName The name of the private endpoint connection to the Azure AI + * Search service with the specified resource group. * @param options The options parameters. */ get( resourceGroupName: string, searchServiceName: string, privateEndpointConnectionName: string, - options?: PrivateEndpointConnectionsGetOptionalParams + options?: PrivateEndpointConnectionsGetOptionalParams, ): Promise; /** * Disconnects the private endpoint connection and deletes it from the search service. * @param resourceGroupName The name of the resource group within the current subscription. You can * obtain this value from the Azure Resource Manager API or the portal. - * @param searchServiceName The name of the Azure Cognitive Search service associated with the - * specified resource group. - * @param privateEndpointConnectionName The name of the private endpoint connection to the Azure - * Cognitive Search service with the specified resource group. + * @param searchServiceName The name of the Azure AI Search service associated with the specified + * resource group. + * @param privateEndpointConnectionName The name of the private endpoint connection to the Azure AI + * Search service with the specified resource group. * @param options The options parameters. */ delete( resourceGroupName: string, searchServiceName: string, privateEndpointConnectionName: string, - options?: PrivateEndpointConnectionsDeleteOptionalParams + options?: PrivateEndpointConnectionsDeleteOptionalParams, ): Promise; } diff --git a/sdk/search/arm-search/src/operationsInterfaces/privateLinkResources.ts b/sdk/search/arm-search/src/operationsInterfaces/privateLinkResources.ts index 69c7b1d93468..5deb1bcff118 100644 --- a/sdk/search/arm-search/src/operationsInterfaces/privateLinkResources.ts +++ b/sdk/search/arm-search/src/operationsInterfaces/privateLinkResources.ts @@ -9,7 +9,7 @@ import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { PrivateLinkResource, - PrivateLinkResourcesListSupportedOptionalParams + PrivateLinkResourcesListSupportedOptionalParams, } from "../models"; /// @@ -19,13 +19,13 @@ export interface PrivateLinkResources { * Gets a list of all supported private link resource types for the given service. * @param resourceGroupName The name of the resource group within the current subscription. You can * obtain this value from the Azure Resource Manager API or the portal. - * @param searchServiceName The name of the Azure Cognitive Search service associated with the - * specified resource group. + * @param searchServiceName The name of the Azure AI Search service associated with the specified + * resource group. * @param options The options parameters. */ listSupported( resourceGroupName: string, searchServiceName: string, - options?: PrivateLinkResourcesListSupportedOptionalParams + options?: PrivateLinkResourcesListSupportedOptionalParams, ): PagedAsyncIterableIterator; } diff --git a/sdk/search/arm-search/src/operationsInterfaces/queryKeys.ts b/sdk/search/arm-search/src/operationsInterfaces/queryKeys.ts index f456bdff3650..725f9c29ca65 100644 --- a/sdk/search/arm-search/src/operationsInterfaces/queryKeys.ts +++ b/sdk/search/arm-search/src/operationsInterfaces/queryKeys.ts @@ -12,32 +12,32 @@ import { QueryKeysListBySearchServiceOptionalParams, QueryKeysCreateOptionalParams, QueryKeysCreateResponse, - QueryKeysDeleteOptionalParams + QueryKeysDeleteOptionalParams, } from "../models"; /// /** Interface representing a QueryKeys. */ export interface QueryKeys { /** - * Returns the list of query API keys for the given Azure Cognitive Search service. + * Returns the list of query API keys for the given Azure AI Search service. * @param resourceGroupName The name of the resource group within the current subscription. You can * obtain this value from the Azure Resource Manager API or the portal. - * @param searchServiceName The name of the Azure Cognitive Search service associated with the - * specified resource group. + * @param searchServiceName The name of the Azure AI Search service associated with the specified + * resource group. * @param options The options parameters. */ listBySearchService( resourceGroupName: string, searchServiceName: string, - options?: QueryKeysListBySearchServiceOptionalParams + options?: QueryKeysListBySearchServiceOptionalParams, ): PagedAsyncIterableIterator; /** * Generates a new query key for the specified search service. You can create up to 50 query keys per * service. * @param resourceGroupName The name of the resource group within the current subscription. You can * obtain this value from the Azure Resource Manager API or the portal. - * @param searchServiceName The name of the Azure Cognitive Search service associated with the - * specified resource group. + * @param searchServiceName The name of the Azure AI Search service associated with the specified + * resource group. * @param name The name of the new query API key. * @param options The options parameters. */ @@ -45,15 +45,15 @@ export interface QueryKeys { resourceGroupName: string, searchServiceName: string, name: string, - options?: QueryKeysCreateOptionalParams + options?: QueryKeysCreateOptionalParams, ): Promise; /** * Deletes the specified query key. Unlike admin keys, query keys are not regenerated. The process for * regenerating a query key is to delete and then recreate it. * @param resourceGroupName The name of the resource group within the current subscription. You can * obtain this value from the Azure Resource Manager API or the portal. - * @param searchServiceName The name of the Azure Cognitive Search service associated with the - * specified resource group. + * @param searchServiceName The name of the Azure AI Search service associated with the specified + * resource group. * @param key The query key to be deleted. Query keys are identified by value, not by name. * @param options The options parameters. */ @@ -61,6 +61,6 @@ export interface QueryKeys { resourceGroupName: string, searchServiceName: string, key: string, - options?: QueryKeysDeleteOptionalParams + options?: QueryKeysDeleteOptionalParams, ): Promise; } diff --git a/sdk/search/arm-search/src/operationsInterfaces/services.ts b/sdk/search/arm-search/src/operationsInterfaces/services.ts index d681f4434bba..691410455fb5 100644 --- a/sdk/search/arm-search/src/operationsInterfaces/services.ts +++ b/sdk/search/arm-search/src/operationsInterfaces/services.ts @@ -21,7 +21,7 @@ import { ServicesGetResponse, ServicesDeleteOptionalParams, ServicesCheckNameAvailabilityOptionalParams, - ServicesCheckNameAvailabilityResponse + ServicesCheckNameAvailabilityResponse, } from "../models"; /// @@ -35,26 +35,26 @@ export interface Services { */ listByResourceGroup( resourceGroupName: string, - options?: ServicesListByResourceGroupOptionalParams + options?: ServicesListByResourceGroupOptionalParams, ): PagedAsyncIterableIterator; /** * Gets a list of all Search services in the given subscription. * @param options The options parameters. */ listBySubscription( - options?: ServicesListBySubscriptionOptionalParams + options?: ServicesListBySubscriptionOptionalParams, ): PagedAsyncIterableIterator; /** * Creates or updates a search service in the given resource group. If the search service already * exists, all properties will be updated with the given values. * @param resourceGroupName The name of the resource group within the current subscription. You can * obtain this value from the Azure Resource Manager API or the portal. - * @param searchServiceName The name of the Azure Cognitive Search service to create or update. Search - * service names must only contain lowercase letters, digits or dashes, cannot use dash as the first - * two or last one characters, cannot contain consecutive dashes, and must be between 2 and 60 - * characters in length. Search service names must be globally unique since they are part of the - * service URI (https://.search.windows.net). You cannot change the service name after the - * service is created. + * @param searchServiceName The name of the Azure AI Search service to create or update. Search service + * names must only contain lowercase letters, digits or dashes, cannot use dash as the first two or + * last one characters, cannot contain consecutive dashes, and must be between 2 and 60 characters in + * length. Search service names must be globally unique since they are part of the service URI + * (https://.search.windows.net). You cannot change the service name after the service is + * created. * @param service The definition of the search service to create or update. * @param options The options parameters. */ @@ -62,7 +62,7 @@ export interface Services { resourceGroupName: string, searchServiceName: string, service: SearchService, - options?: ServicesCreateOrUpdateOptionalParams + options?: ServicesCreateOrUpdateOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -74,12 +74,12 @@ export interface Services { * exists, all properties will be updated with the given values. * @param resourceGroupName The name of the resource group within the current subscription. You can * obtain this value from the Azure Resource Manager API or the portal. - * @param searchServiceName The name of the Azure Cognitive Search service to create or update. Search - * service names must only contain lowercase letters, digits or dashes, cannot use dash as the first - * two or last one characters, cannot contain consecutive dashes, and must be between 2 and 60 - * characters in length. Search service names must be globally unique since they are part of the - * service URI (https://.search.windows.net). You cannot change the service name after the - * service is created. + * @param searchServiceName The name of the Azure AI Search service to create or update. Search service + * names must only contain lowercase letters, digits or dashes, cannot use dash as the first two or + * last one characters, cannot contain consecutive dashes, and must be between 2 and 60 characters in + * length. Search service names must be globally unique since they are part of the service URI + * (https://.search.windows.net). You cannot change the service name after the service is + * created. * @param service The definition of the search service to create or update. * @param options The options parameters. */ @@ -87,13 +87,13 @@ export interface Services { resourceGroupName: string, searchServiceName: string, service: SearchService, - options?: ServicesCreateOrUpdateOptionalParams + options?: ServicesCreateOrUpdateOptionalParams, ): Promise; /** * Updates an existing search service in the given resource group. * @param resourceGroupName The name of the resource group within the current subscription. You can * obtain this value from the Azure Resource Manager API or the portal. - * @param searchServiceName The name of the Azure Cognitive Search service to update. + * @param searchServiceName The name of the Azure AI Search service to update. * @param service The definition of the search service to update. * @param options The options parameters. */ @@ -101,33 +101,33 @@ export interface Services { resourceGroupName: string, searchServiceName: string, service: SearchServiceUpdate, - options?: ServicesUpdateOptionalParams + options?: ServicesUpdateOptionalParams, ): Promise; /** * Gets the search service with the given name in the given resource group. * @param resourceGroupName The name of the resource group within the current subscription. You can * obtain this value from the Azure Resource Manager API or the portal. - * @param searchServiceName The name of the Azure Cognitive Search service associated with the - * specified resource group. + * @param searchServiceName The name of the Azure AI Search service associated with the specified + * resource group. * @param options The options parameters. */ get( resourceGroupName: string, searchServiceName: string, - options?: ServicesGetOptionalParams + options?: ServicesGetOptionalParams, ): Promise; /** * Deletes a search service in the given resource group, along with its associated resources. * @param resourceGroupName The name of the resource group within the current subscription. You can * obtain this value from the Azure Resource Manager API or the portal. - * @param searchServiceName The name of the Azure Cognitive Search service associated with the - * specified resource group. + * @param searchServiceName The name of the Azure AI Search service associated with the specified + * resource group. * @param options The options parameters. */ delete( resourceGroupName: string, searchServiceName: string, - options?: ServicesDeleteOptionalParams + options?: ServicesDeleteOptionalParams, ): Promise; /** * Checks whether or not the given search service name is available for use. Search service names must @@ -139,6 +139,6 @@ export interface Services { */ checkNameAvailability( name: string, - options?: ServicesCheckNameAvailabilityOptionalParams + options?: ServicesCheckNameAvailabilityOptionalParams, ): Promise; } diff --git a/sdk/search/arm-search/src/operationsInterfaces/sharedPrivateLinkResources.ts b/sdk/search/arm-search/src/operationsInterfaces/sharedPrivateLinkResources.ts index f5d34e9b4015..66cb5c606d2e 100644 --- a/sdk/search/arm-search/src/operationsInterfaces/sharedPrivateLinkResources.ts +++ b/sdk/search/arm-search/src/operationsInterfaces/sharedPrivateLinkResources.ts @@ -15,7 +15,7 @@ import { SharedPrivateLinkResourcesCreateOrUpdateResponse, SharedPrivateLinkResourcesGetOptionalParams, SharedPrivateLinkResourcesGetResponse, - SharedPrivateLinkResourcesDeleteOptionalParams + SharedPrivateLinkResourcesDeleteOptionalParams, } from "../models"; /// @@ -25,24 +25,24 @@ export interface SharedPrivateLinkResources { * Gets a list of all shared private link resources managed by the given service. * @param resourceGroupName The name of the resource group within the current subscription. You can * obtain this value from the Azure Resource Manager API or the portal. - * @param searchServiceName The name of the Azure Cognitive Search service associated with the - * specified resource group. + * @param searchServiceName The name of the Azure AI Search service associated with the specified + * resource group. * @param options The options parameters. */ listByService( resourceGroupName: string, searchServiceName: string, - options?: SharedPrivateLinkResourcesListByServiceOptionalParams + options?: SharedPrivateLinkResourcesListByServiceOptionalParams, ): PagedAsyncIterableIterator; /** * Initiates the creation or update of a shared private link resource managed by the search service in * the given resource group. * @param resourceGroupName The name of the resource group within the current subscription. You can * obtain this value from the Azure Resource Manager API or the portal. - * @param searchServiceName The name of the Azure Cognitive Search service associated with the - * specified resource group. + * @param searchServiceName The name of the Azure AI Search service associated with the specified + * resource group. * @param sharedPrivateLinkResourceName The name of the shared private link resource managed by the - * Azure Cognitive Search service within the specified resource group. + * Azure AI Search service within the specified resource group. * @param sharedPrivateLinkResource The definition of the shared private link resource to create or * update. * @param options The options parameters. @@ -52,7 +52,7 @@ export interface SharedPrivateLinkResources { searchServiceName: string, sharedPrivateLinkResourceName: string, sharedPrivateLinkResource: SharedPrivateLinkResource, - options?: SharedPrivateLinkResourcesCreateOrUpdateOptionalParams + options?: SharedPrivateLinkResourcesCreateOrUpdateOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -64,10 +64,10 @@ export interface SharedPrivateLinkResources { * the given resource group. * @param resourceGroupName The name of the resource group within the current subscription. You can * obtain this value from the Azure Resource Manager API or the portal. - * @param searchServiceName The name of the Azure Cognitive Search service associated with the - * specified resource group. + * @param searchServiceName The name of the Azure AI Search service associated with the specified + * resource group. * @param sharedPrivateLinkResourceName The name of the shared private link resource managed by the - * Azure Cognitive Search service within the specified resource group. + * Azure AI Search service within the specified resource group. * @param sharedPrivateLinkResource The definition of the shared private link resource to create or * update. * @param options The options parameters. @@ -77,55 +77,55 @@ export interface SharedPrivateLinkResources { searchServiceName: string, sharedPrivateLinkResourceName: string, sharedPrivateLinkResource: SharedPrivateLinkResource, - options?: SharedPrivateLinkResourcesCreateOrUpdateOptionalParams + options?: SharedPrivateLinkResourcesCreateOrUpdateOptionalParams, ): Promise; /** * Gets the details of the shared private link resource managed by the search service in the given * resource group. * @param resourceGroupName The name of the resource group within the current subscription. You can * obtain this value from the Azure Resource Manager API or the portal. - * @param searchServiceName The name of the Azure Cognitive Search service associated with the - * specified resource group. + * @param searchServiceName The name of the Azure AI Search service associated with the specified + * resource group. * @param sharedPrivateLinkResourceName The name of the shared private link resource managed by the - * Azure Cognitive Search service within the specified resource group. + * Azure AI Search service within the specified resource group. * @param options The options parameters. */ get( resourceGroupName: string, searchServiceName: string, sharedPrivateLinkResourceName: string, - options?: SharedPrivateLinkResourcesGetOptionalParams + options?: SharedPrivateLinkResourcesGetOptionalParams, ): Promise; /** * Initiates the deletion of the shared private link resource from the search service. * @param resourceGroupName The name of the resource group within the current subscription. You can * obtain this value from the Azure Resource Manager API or the portal. - * @param searchServiceName The name of the Azure Cognitive Search service associated with the - * specified resource group. + * @param searchServiceName The name of the Azure AI Search service associated with the specified + * resource group. * @param sharedPrivateLinkResourceName The name of the shared private link resource managed by the - * Azure Cognitive Search service within the specified resource group. + * Azure AI Search service within the specified resource group. * @param options The options parameters. */ beginDelete( resourceGroupName: string, searchServiceName: string, sharedPrivateLinkResourceName: string, - options?: SharedPrivateLinkResourcesDeleteOptionalParams + options?: SharedPrivateLinkResourcesDeleteOptionalParams, ): Promise, void>>; /** * Initiates the deletion of the shared private link resource from the search service. * @param resourceGroupName The name of the resource group within the current subscription. You can * obtain this value from the Azure Resource Manager API or the portal. - * @param searchServiceName The name of the Azure Cognitive Search service associated with the - * specified resource group. + * @param searchServiceName The name of the Azure AI Search service associated with the specified + * resource group. * @param sharedPrivateLinkResourceName The name of the shared private link resource managed by the - * Azure Cognitive Search service within the specified resource group. + * Azure AI Search service within the specified resource group. * @param options The options parameters. */ beginDeleteAndWait( resourceGroupName: string, searchServiceName: string, sharedPrivateLinkResourceName: string, - options?: SharedPrivateLinkResourcesDeleteOptionalParams + options?: SharedPrivateLinkResourcesDeleteOptionalParams, ): Promise; } diff --git a/sdk/search/arm-search/src/operationsInterfaces/usages.ts b/sdk/search/arm-search/src/operationsInterfaces/usages.ts index 18cfe26e6d6b..c560fb083128 100644 --- a/sdk/search/arm-search/src/operationsInterfaces/usages.ts +++ b/sdk/search/arm-search/src/operationsInterfaces/usages.ts @@ -9,19 +9,19 @@ import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { QuotaUsageResult, - UsagesListBySubscriptionOptionalParams + UsagesListBySubscriptionOptionalParams, } from "../models"; /// /** Interface representing a Usages. */ export interface Usages { /** - * Gets a list of all Search quota usages in the given subscription. + * Get a list of all Azure AI Search quota usages across the subscription. * @param location The unique location name for a Microsoft Azure geographic region. * @param options The options parameters. */ listBySubscription( location: string, - options?: UsagesListBySubscriptionOptionalParams + options?: UsagesListBySubscriptionOptionalParams, ): PagedAsyncIterableIterator; } diff --git a/sdk/search/arm-search/src/pagingHelper.ts b/sdk/search/arm-search/src/pagingHelper.ts index 269a2b9814b5..205cccc26592 100644 --- a/sdk/search/arm-search/src/pagingHelper.ts +++ b/sdk/search/arm-search/src/pagingHelper.ts @@ -28,7 +28,7 @@ export function getContinuationToken(page: unknown): string | undefined { export function setContinuationToken( page: unknown, - continuationToken: string | undefined + continuationToken: string | undefined, ): void { if (typeof page !== "object" || page === null || !continuationToken) { return; diff --git a/sdk/search/arm-search/src/searchManagementClient.ts b/sdk/search/arm-search/src/searchManagementClient.ts index e042653e4671..c470c0249436 100644 --- a/sdk/search/arm-search/src/searchManagementClient.ts +++ b/sdk/search/arm-search/src/searchManagementClient.ts @@ -11,7 +11,7 @@ import * as coreRestPipeline from "@azure/core-rest-pipeline"; import { PipelineRequest, PipelineResponse, - SendRequest + SendRequest, } from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; import { @@ -22,7 +22,8 @@ import { PrivateLinkResourcesImpl, PrivateEndpointConnectionsImpl, SharedPrivateLinkResourcesImpl, - UsagesImpl + UsagesImpl, + NetworkSecurityPerimeterConfigurationsImpl, } from "./operations"; import { Operations, @@ -32,14 +33,15 @@ import { PrivateLinkResources, PrivateEndpointConnections, SharedPrivateLinkResources, - Usages + Usages, + NetworkSecurityPerimeterConfigurations, } from "./operationsInterfaces"; import * as Parameters from "./models/parameters"; import * as Mappers from "./models/mappers"; import { SearchManagementClientOptionalParams, UsageBySubscriptionSkuOptionalParams, - UsageBySubscriptionSkuResponse + UsageBySubscriptionSkuResponse, } from "./models"; export class SearchManagementClient extends coreClient.ServiceClient { @@ -57,7 +59,7 @@ export class SearchManagementClient extends coreClient.ServiceClient { constructor( credentials: coreAuth.TokenCredential, subscriptionId: string, - options?: SearchManagementClientOptionalParams + options?: SearchManagementClientOptionalParams, ) { if (credentials === undefined) { throw new Error("'credentials' cannot be null"); @@ -72,10 +74,10 @@ export class SearchManagementClient extends coreClient.ServiceClient { } const defaults: SearchManagementClientOptionalParams = { requestContentType: "application/json; charset=utf-8", - credential: credentials + credential: credentials, }; - const packageDetails = `azsdk-js-arm-search/3.2.0`; + const packageDetails = `azsdk-js-arm-search/3.3.0-beta.1`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -85,20 +87,21 @@ export class SearchManagementClient extends coreClient.ServiceClient { ...defaults, ...options, userAgentOptions: { - userAgentPrefix + userAgentPrefix, }, endpoint: - options.endpoint ?? options.baseUri ?? "https://management.azure.com" + options.endpoint ?? options.baseUri ?? "https://management.azure.com", }; super(optionsWithDefaults); let bearerTokenAuthenticationPolicyFound: boolean = false; if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) { - const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies(); + const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = + options.pipeline.getOrderedPolicies(); bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( (pipelinePolicy) => pipelinePolicy.name === - coreRestPipeline.bearerTokenAuthenticationPolicyName + coreRestPipeline.bearerTokenAuthenticationPolicyName, ); } if ( @@ -108,7 +111,7 @@ export class SearchManagementClient extends coreClient.ServiceClient { !bearerTokenAuthenticationPolicyFound ) { this.pipeline.removePolicy({ - name: coreRestPipeline.bearerTokenAuthenticationPolicyName + name: coreRestPipeline.bearerTokenAuthenticationPolicyName, }); this.pipeline.addPolicy( coreRestPipeline.bearerTokenAuthenticationPolicy({ @@ -118,9 +121,9 @@ export class SearchManagementClient extends coreClient.ServiceClient { `${optionsWithDefaults.endpoint}/.default`, challengeCallbacks: { authorizeRequestOnChallenge: - coreClient.authorizeRequestOnClaimChallenge - } - }) + coreClient.authorizeRequestOnClaimChallenge, + }, + }), ); } // Parameter assignments @@ -128,7 +131,7 @@ export class SearchManagementClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2023-11-01"; + this.apiVersion = options.apiVersion || "2024-03-01-preview"; this.operations = new OperationsImpl(this); this.adminKeys = new AdminKeysImpl(this); this.queryKeys = new QueryKeysImpl(this); @@ -137,6 +140,8 @@ export class SearchManagementClient extends coreClient.ServiceClient { this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(this); this.sharedPrivateLinkResources = new SharedPrivateLinkResourcesImpl(this); this.usages = new UsagesImpl(this); + this.networkSecurityPerimeterConfigurations = + new NetworkSecurityPerimeterConfigurationsImpl(this); this.addCustomApiVersionPolicy(options.apiVersion); } @@ -149,7 +154,7 @@ export class SearchManagementClient extends coreClient.ServiceClient { name: "CustomApiVersionPolicy", async sendRequest( request: PipelineRequest, - next: SendRequest + next: SendRequest, ): Promise { const param = request.url.split("?"); if (param.length > 1) { @@ -163,7 +168,7 @@ export class SearchManagementClient extends coreClient.ServiceClient { request.url = param[0] + "?" + newParams.join("&"); } return next(request); - } + }, }; this.pipeline.addPolicy(apiVersionPolicy); } @@ -171,17 +176,17 @@ export class SearchManagementClient extends coreClient.ServiceClient { /** * Gets the quota usage for a search sku in the given subscription. * @param location The unique location name for a Microsoft Azure geographic region. - * @param skuName The unique search service sku name supported by Azure Cognitive Search. + * @param skuName The unique SKU name that identifies a billable tier. * @param options The options parameters. */ usageBySubscriptionSku( location: string, skuName: string, - options?: UsageBySubscriptionSkuOptionalParams + options?: UsageBySubscriptionSkuOptionalParams, ): Promise { return this.sendOperationRequest( { location, skuName, options }, - usageBySubscriptionSkuOperationSpec + usageBySubscriptionSkuOperationSpec, ); } @@ -193,29 +198,29 @@ export class SearchManagementClient extends coreClient.ServiceClient { privateEndpointConnections: PrivateEndpointConnections; sharedPrivateLinkResources: SharedPrivateLinkResources; usages: Usages; + networkSecurityPerimeterConfigurations: NetworkSecurityPerimeterConfigurations; } // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const usageBySubscriptionSkuOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Search/locations/{location}/usages/{skuName}", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Search/locations/{location}/usages/{skuName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.QuotaUsageResult + bodyMapper: Mappers.QuotaUsageResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.location, - Parameters.skuName + Parameters.skuName, ], headerParameters: [Parameters.accept, Parameters.clientRequestId], - serializer + serializer, };