diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index e92f0b234062..55204748b0aa 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -3991,7 +3991,7 @@ packages: dependencies: semver: 7.4.0 shelljs: 0.8.5 - typescript: 5.1.0-dev.20230420 + typescript: 5.1.0-dev.20230423 dev: false /ecdsa-sig-formatter/1.0.11: @@ -8859,8 +8859,8 @@ packages: hasBin: true dev: false - /typescript/5.1.0-dev.20230420: - resolution: {integrity: sha512-ytvKM7THT08QHjFP6v8kF3RtJWMQ/wWeQTIbe3kveVDcmstVrS5IZ47c9Y9GIYI2WaFVVjNu2YNLwSwIt82Fzg==} + /typescript/5.1.0-dev.20230423: + resolution: {integrity: sha512-WfMjpk8/hc0HGzFMGZcef08plCo/XirSMUlT6r6FfTLw0wIwrdcGDqHkYVaOV/F0EKirZNGpwYEJ30iIausB7g==} engines: {node: '>=14.17'} hasBin: true dev: false @@ -14627,7 +14627,7 @@ packages: dev: false file:projects/arm-search.tgz: - resolution: {integrity: sha512-sxxGWJZ5k8lwroSyoYBTLN9Gea/7C0vvxTFH230e6n54+Nzuap4s2lK+xu5vReifXQx+6qVQFP32H3/BCyMTHA==, tarball: file:projects/arm-search.tgz} + resolution: {integrity: sha512-0wUR5UYeRoWmm2HncZluEaR09ZCKbz9Rl1fVH7bd3Bu8CjvsnMm2K2H6qNGGlymh1CV5I/5qsqmdohcB4gR9yA==, tarball: file:projects/arm-search.tgz} name: '@rush-temp/arm-search' version: 0.0.0 dependencies: @@ -14641,13 +14641,14 @@ packages: '@types/node': 14.18.42 chai: 4.3.7 cross-env: 7.0.3 - mkdirp: 1.0.4 + dotenv: 16.0.3 + mkdirp: 2.1.6 mocha: 7.2.0 rimraf: 3.0.2 rollup: 2.79.1 rollup-plugin-sourcemaps: 0.6.3_c43y4oaxxwie3ialrfuzfwwhqq tslib: 2.5.0 - typescript: 5.0.4 + typescript: 4.8.4 uglify-js: 3.17.4 transitivePeerDependencies: - supports-color @@ -18508,7 +18509,7 @@ packages: dev: false file:projects/perf-ai-metrics-advisor.tgz: - resolution: {integrity: sha512-W+4bDz+P9sQyIAoCpexjQEi5ojYMCroT9iQzznP0ikqajy0gPIxYpzFYjVu7ebeq+Xi4k+Uo8TihjfGiTVF2sw==, tarball: file:projects/perf-ai-metrics-advisor.tgz} + resolution: {integrity: sha512-f8UQv7K6vv7GvgXMrU6c4bAQ2ZbQiYPX/qUUrBBpzEVN70FT/oAwjCWzXKgT1S9qbZihbWv88DxUu6rm11nrPQ==, tarball: file:projects/perf-ai-metrics-advisor.tgz} name: '@rush-temp/perf-ai-metrics-advisor' version: 0.0.0 dependencies: @@ -18524,7 +18525,6 @@ packages: transitivePeerDependencies: - '@swc/core' - '@swc/wasm' - - encoding - supports-color dev: false diff --git a/sdk/search/arm-search/CHANGELOG.md b/sdk/search/arm-search/CHANGELOG.md index b880434145c3..b0533761266a 100644 --- a/sdk/search/arm-search/CHANGELOG.md +++ b/sdk/search/arm-search/CHANGELOG.md @@ -1,15 +1,27 @@ # Release History + +## 3.2.0 (2023-04-24) + +**Features** -## 3.1.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - + - Added Interface DataPlaneAadOrApiKeyAuthOption + - Added Interface DataPlaneAuthOptions + - Added Interface EncryptionWithCmk + - Added Type Alias AadAuthFailureMode + - Added Type Alias PrivateLinkServiceConnectionProvisioningState + - Added Type Alias SearchEncryptionComplianceStatus + - Added Type Alias SearchEncryptionWithCmk + - Interface PrivateEndpointConnectionProperties has a new optional parameter groupId + - Interface PrivateEndpointConnectionProperties has a new optional parameter provisioningState + - Interface SearchService has a new optional parameter authOptions + - Interface SearchService has a new optional parameter disableLocalAuth + - Interface SearchService has a new optional parameter encryptionWithCmk + - Interface SearchServiceUpdate has a new optional parameter authOptions + - Interface SearchServiceUpdate has a new optional parameter disableLocalAuth + - Interface SearchServiceUpdate has a new optional parameter encryptionWithCmk + - Added Enum KnownPrivateLinkServiceConnectionProvisioningState + + ## 3.1.0 (2022-12-07) **Features** diff --git a/sdk/search/arm-search/LICENSE b/sdk/search/arm-search/LICENSE index 5d1d36e0af80..3a1d9b6f24f7 100644 --- a/sdk/search/arm-search/LICENSE +++ b/sdk/search/arm-search/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2022 Microsoft +Copyright (c) 2023 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/_meta.json b/sdk/search/arm-search/_meta.json index ce4aa58457e5..de499d135729 100644 --- a/sdk/search/arm-search/_meta.json +++ b/sdk/search/arm-search/_meta.json @@ -1,8 +1,8 @@ { - "commit": "0cd7b3e83d5e7e21222dcc4bdde4565562da0cdf", - "readme": "specification\\search\\resource-manager\\readme.md", - "autorest_command": "autorest --version=3.9.3 --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.0-rc.4 --generate-sample=true", + "commit": "17377159d52d9eaa40303a10bfc0ec270f1a684d", + "readme": "specification/search/resource-manager/readme.md", + "autorest_command": "autorest --version=3.9.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/search/resource-manager/readme.md --use=@autorest/typescript@6.0.0-rc.10", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.5.2", - "use": "@autorest/typescript@6.0.0-rc.4" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.0", + "use": "@autorest/typescript@6.0.0-rc.10" } \ No newline at end of file diff --git a/sdk/search/arm-search/package.json b/sdk/search/arm-search/package.json index fae5a45c4b09..10b3486094d0 100644 --- a/sdk/search/arm-search/package.json +++ b/sdk/search/arm-search/package.json @@ -3,15 +3,15 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for SearchManagementClient.", - "version": "3.1.1", + "version": "3.2.0", "engines": { "node": ">=14.0.0" }, "dependencies": { - "@azure/core-lro": "^2.2.0", + "@azure/core-lro": "^2.5.0", "@azure/abort-controller": "^1.0.0", "@azure/core-paging": "^1.2.0", - "@azure/core-client": "^1.6.1", + "@azure/core-client": "^1.7.0", "@azure/core-auth": "^1.3.0", "@azure/core-rest-pipeline": "^1.8.0", "tslib": "^2.2.0" @@ -33,12 +33,13 @@ "@rollup/plugin-json": "^6.0.0", "@rollup/plugin-multi-entry": "^6.0.0", "@rollup/plugin-node-resolve": "^13.1.3", - "mkdirp": "^1.0.4", + "mkdirp": "^2.1.2", "rollup": "^2.66.1", "rollup-plugin-sourcemaps": "^0.6.3", - "typescript": "~5.0.0", + "typescript": "~4.8.0", "uglify-js": "^3.4.9", "rimraf": "^3.0.0", + "dotenv": "^16.0.0", "@azure/identity": "^2.0.1", "@azure-tools/test-recorder": "^3.0.0", "@azure-tools/test-credential": "^1.0.0", @@ -49,7 +50,6 @@ "@types/node": "^14.0.0", "@azure/dev-tool": "^1.0.0" }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/search/arm-search", "repository": { "type": "git", "url": "https://github.com/Azure/azure-sdk-for-js.git" @@ -111,12 +111,5 @@ ] }, "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-search?view=azure-node-preview" - } -} + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/search/arm-search" +} \ 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 f6f598f7b086..600676db62e1 100644 --- a/sdk/search/arm-search/review/arm-search.api.md +++ b/sdk/search/arm-search/review/arm-search.api.md @@ -6,9 +6,12 @@ import * as coreAuth from '@azure/core-auth'; import * as coreClient from '@azure/core-client'; +import { OperationState } from '@azure/core-lro'; import { PagedAsyncIterableIterator } from '@azure/core-paging'; -import { PollerLike } from '@azure/core-lro'; -import { PollOperationState } from '@azure/core-lro'; +import { SimplePollerLike } from '@azure/core-lro'; + +// @public +export type AadAuthFailureMode = "http403" | "http401WithBearerChallenge"; // @public export type AdminKeyKind = "primary" | "secondary"; @@ -72,6 +75,23 @@ export interface CloudErrorBody { target?: string; } +// @public +export interface DataPlaneAadOrApiKeyAuthOption { + aadAuthFailureMode?: AadAuthFailureMode; +} + +// @public +export interface DataPlaneAuthOptions { + aadOrApiKey?: DataPlaneAadOrApiKeyAuthOption; + apiKeyOnly?: Record; +} + +// @public +export interface EncryptionWithCmk { + readonly encryptionComplianceStatus?: SearchEncryptionComplianceStatus; + enforcement?: SearchEncryptionWithCmk; +} + // @public export function getContinuationToken(page: unknown): string | undefined; @@ -93,6 +113,16 @@ export interface IpRule { value?: string; } +// @public +export enum KnownPrivateLinkServiceConnectionProvisioningState { + Canceled = "Canceled", + Deleting = "Deleting", + Failed = "Failed", + Incomplete = "Incomplete", + Succeeded = "Succeeded", + Updating = "Updating" +} + // @public export enum KnownSharedPrivateLinkResourceAsyncOperationResult { Failed = "Failed", @@ -162,8 +192,10 @@ export interface PrivateEndpointConnectionListResult { // @public export interface PrivateEndpointConnectionProperties { + groupId?: string; privateEndpoint?: PrivateEndpointConnectionPropertiesPrivateEndpoint; privateLinkServiceConnectionState?: PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState; + provisioningState?: PrivateLinkServiceConnectionProvisioningState; } // @public @@ -257,6 +289,9 @@ export interface PrivateLinkResourcesResult { readonly value?: PrivateLinkResource[]; } +// @public +export type PrivateLinkServiceConnectionProvisioningState = string; + // @public export type PrivateLinkServiceConnectionStatus = "Pending" | "Approved" | "Rejected" | "Disconnected"; @@ -315,6 +350,12 @@ export interface Resource { readonly type?: string; } +// @public +export type SearchEncryptionComplianceStatus = "Compliant" | "NonCompliant"; + +// @public +export type SearchEncryptionWithCmk = "Disabled" | "Enabled" | "Unspecified"; + // @public (undocumented) export class SearchManagementClient extends coreClient.ServiceClient { // (undocumented) @@ -354,6 +395,9 @@ export interface SearchManagementRequestOptions { // @public export interface SearchService extends TrackedResource { + authOptions?: DataPlaneAuthOptions; + disableLocalAuth?: boolean; + encryptionWithCmk?: EncryptionWithCmk; hostingMode?: HostingMode; identity?: Identity; networkRuleSet?: NetworkRuleSet; @@ -379,6 +423,9 @@ export type SearchServiceStatus = "running" | "provisioning" | "deleting" | "deg // @public export interface SearchServiceUpdate extends Resource { + authOptions?: DataPlaneAuthOptions; + disableLocalAuth?: boolean; + encryptionWithCmk?: EncryptionWithCmk; hostingMode?: HostingMode; identity?: Identity; location?: string; @@ -399,7 +446,7 @@ export interface SearchServiceUpdate extends Resource { // @public export interface Services { - beginCreateOrUpdate(resourceGroupName: string, searchServiceName: string, service: SearchService, options?: ServicesCreateOrUpdateOptionalParams): Promise, ServicesCreateOrUpdateResponse>>; + beginCreateOrUpdate(resourceGroupName: string, searchServiceName: string, service: SearchService, options?: ServicesCreateOrUpdateOptionalParams): Promise, ServicesCreateOrUpdateResponse>>; beginCreateOrUpdateAndWait(resourceGroupName: string, searchServiceName: string, service: SearchService, options?: ServicesCreateOrUpdateOptionalParams): Promise; checkNameAvailability(name: string, options?: ServicesCheckNameAvailabilityOptionalParams): Promise; delete(resourceGroupName: string, searchServiceName: string, options?: ServicesDeleteOptionalParams): Promise; @@ -522,9 +569,9 @@ export type SharedPrivateLinkResourceProvisioningState = "Updating" | "Deleting" // @public export interface SharedPrivateLinkResources { - beginCreateOrUpdate(resourceGroupName: string, searchServiceName: string, sharedPrivateLinkResourceName: string, sharedPrivateLinkResource: SharedPrivateLinkResource, options?: SharedPrivateLinkResourcesCreateOrUpdateOptionalParams): Promise, SharedPrivateLinkResourcesCreateOrUpdateResponse>>; + beginCreateOrUpdate(resourceGroupName: string, searchServiceName: string, sharedPrivateLinkResourceName: string, sharedPrivateLinkResource: SharedPrivateLinkResource, options?: SharedPrivateLinkResourcesCreateOrUpdateOptionalParams): Promise, SharedPrivateLinkResourcesCreateOrUpdateResponse>>; beginCreateOrUpdateAndWait(resourceGroupName: string, searchServiceName: string, sharedPrivateLinkResourceName: string, sharedPrivateLinkResource: SharedPrivateLinkResource, options?: SharedPrivateLinkResourcesCreateOrUpdateOptionalParams): Promise; - beginDelete(resourceGroupName: string, searchServiceName: string, sharedPrivateLinkResourceName: string, options?: SharedPrivateLinkResourcesDeleteOptionalParams): Promise, void>>; + beginDelete(resourceGroupName: string, searchServiceName: string, sharedPrivateLinkResourceName: string, options?: SharedPrivateLinkResourcesDeleteOptionalParams): Promise, void>>; beginDeleteAndWait(resourceGroupName: string, searchServiceName: string, sharedPrivateLinkResourceName: string, options?: SharedPrivateLinkResourcesDeleteOptionalParams): Promise; get(resourceGroupName: string, searchServiceName: string, sharedPrivateLinkResourceName: string, options?: SharedPrivateLinkResourcesGetOptionalParams): Promise; listByService(resourceGroupName: string, searchServiceName: string, options?: SharedPrivateLinkResourcesListByServiceOptionalParams): PagedAsyncIterableIterator; diff --git a/sdk/search/arm-search/src/lroImpl.ts b/sdk/search/arm-search/src/lroImpl.ts index 518d5f053b4e..dd803cd5e28c 100644 --- a/sdk/search/arm-search/src/lroImpl.ts +++ b/sdk/search/arm-search/src/lroImpl.ts @@ -6,29 +6,37 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { AbortSignalLike } from "@azure/abort-controller"; import { LongRunningOperation, LroResponse } from "@azure/core-lro"; -export class LroImpl implements LongRunningOperation { - constructor( - private sendOperationFn: (args: any, spec: any) => Promise>, - private args: Record, - private spec: { - readonly requestBody?: unknown; - readonly path?: string; - readonly httpMethod: string; - } & Record, - public requestPath: string = spec.path!, - public requestMethod: string = spec.httpMethod - ) {} - public async sendInitialRequest(): Promise> { - return this.sendOperationFn(this.args, this.spec); - } - public async sendPollRequest(path: string): Promise> { - const { requestBody, ...restSpec } = this.spec; - return this.sendOperationFn(this.args, { - ...restSpec, - path, - httpMethod: "GET" - }); - } +export function createLroSpec(inputs: { + sendOperationFn: (args: any, spec: any) => Promise>; + args: Record; + spec: { + readonly requestBody?: unknown; + readonly path?: string; + readonly httpMethod: string; + } & Record; +}): LongRunningOperation { + const { args, spec, sendOperationFn } = inputs; + return { + requestMethod: spec.httpMethod, + requestPath: spec.path!, + sendInitialRequest: () => sendOperationFn(args, spec), + sendPollRequest: ( + path: string, + options?: { abortSignal?: AbortSignalLike } + ) => { + const { requestBody, ...restSpec } = spec; + return sendOperationFn(args, { + ...restSpec, + httpMethod: "GET", + path, + abortSignal: options?.abortSignal + }); + } + }; } diff --git a/sdk/search/arm-search/src/models/index.ts b/sdk/search/arm-search/src/models/index.ts index a777b121c7f9..4fa84a65f547 100644 --- a/sdk/search/arm-search/src/models/index.ts +++ b/sdk/search/arm-search/src/models/index.ts @@ -132,12 +132,41 @@ export interface IpRule { value?: string; } +/** 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. */ + 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'. + * 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. */ +export interface DataPlaneAuthOptions { + /** Indicates that only the API key needs to 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. */ + aadOrApiKey?: DataPlaneAadOrApiKeyAuthOption; +} + +/** Indicates that either the API key or an access token from Azure Active Directory 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. */ + aadAuthFailureMode?: AadAuthFailureMode; +} + /** Describes the properties of an existing Private Endpoint connection to the Azure Cognitive 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. */ privateLinkServiceConnectionState?: PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState; + /** The group id from the provider of resource the private link service connection is for. */ + groupId?: string; + /** The provisioning state of the private link service connection. Can be Updating, Deleting, Failed, Succeeded, or Incomplete */ + provisioningState?: PrivateLinkServiceConnectionProvisioningState; } /** The private endpoint resource from Microsoft.Network provider. */ @@ -200,12 +229,12 @@ export interface Sku { /** Identity for the resource. */ export interface Identity { /** - * The principal ID of resource identity. + * The principal ID of the system-assigned identity of the search service. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly principalId?: string; /** - * The tenant ID of resource. + * The tenant ID of the system-assigned identity of the search service. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly tenantId?: string; @@ -216,7 +245,7 @@ export interface Identity { /** Response containing a list of Azure Cognitive 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[]; @@ -406,6 +435,12 @@ export interface SearchServiceUpdate extends Resource { readonly provisioningState?: ProvisioningState; /** Network specific rules that determine how the Azure Cognitive Search service may be reached. */ networkRuleSet?: NetworkRuleSet; + /** 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; /** * The list of private endpoint connections to the Azure Cognitive Search service. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -458,6 +493,12 @@ export interface SearchService extends TrackedResource { readonly provisioningState?: ProvisioningState; /** Network specific rules that determine how the Azure Cognitive Search service may be reached. */ networkRuleSet?: NetworkRuleSet; + /** 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; /** * The list of private endpoint connections to the Azure Cognitive Search service. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -476,11 +517,41 @@ export interface SearchManagementRequestOptions { clientRequestId?: 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. */ + Updating = "Updating", + /** The private link service connection is in the process of being deleted. */ + Deleting = "Deleting", + /** The private link service connection has failed to be provisioned or deleted. */ + Failed = "Failed", + /** The private link service connection has finished provisioning and is ready for approval. */ + 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" +} + +/** + * Defines values for PrivateLinkServiceConnectionProvisioningState. \ + * {@link KnownPrivateLinkServiceConnectionProvisioningState} can be used interchangeably with PrivateLinkServiceConnectionProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Updating**: The private link service connection is in the process of being created along with other resources for it to be fully functional. \ + * **Deleting**: The private link service connection is in the process of being deleted. \ + * **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 + */ +export type PrivateLinkServiceConnectionProvisioningState = string; + /** Known values of {@link UnavailableNameReason} that the service accepts. */ export enum KnownUnavailableNameReason { - /** Invalid */ + /** The search service name does not match naming requirements. */ Invalid = "Invalid", - /** AlreadyExists */ + /** The search service name is already assigned to a different search service. */ AlreadyExists = "AlreadyExists" } @@ -489,8 +560,8 @@ 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** \ - * **AlreadyExists** + * **Invalid**: The search service name does not match naming requirements. \ + * **AlreadyExists**: The search service name is already assigned to a different search service. */ export type UnavailableNameReason = string; @@ -530,6 +601,12 @@ export type SearchServiceStatus = | "error"; /** Defines values for ProvisioningState. */ export type ProvisioningState = "succeeded" | "provisioning" | "failed"; +/** Defines values for SearchEncryptionWithCmk. */ +export type SearchEncryptionWithCmk = "Disabled" | "Enabled" | "Unspecified"; +/** Defines values for SearchEncryptionComplianceStatus. */ +export type SearchEncryptionComplianceStatus = "Compliant" | "NonCompliant"; +/** Defines values for AadAuthFailureMode. */ +export type AadAuthFailureMode = "http403" | "http401WithBearerChallenge"; /** Defines values for PrivateLinkServiceConnectionStatus. */ export type PrivateLinkServiceConnectionStatus = | "Pending" diff --git a/sdk/search/arm-search/src/models/mappers.ts b/sdk/search/arm-search/src/models/mappers.ts index 59fb037bccc8..9ddd9d07a3a1 100644 --- a/sdk/search/arm-search/src/models/mappers.ts +++ b/sdk/search/arm-search/src/models/mappers.ts @@ -263,6 +263,69 @@ export const IpRule: coreClient.CompositeMapper = { } }; +export const EncryptionWithCmk: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EncryptionWithCmk", + modelProperties: { + enforcement: { + serializedName: "enforcement", + type: { + name: "Enum", + allowedValues: ["Disabled", "Enabled", "Unspecified"] + } + }, + encryptionComplianceStatus: { + serializedName: "encryptionComplianceStatus", + readOnly: true, + type: { + name: "Enum", + allowedValues: ["Compliant", "NonCompliant"] + } + } + } + } +}; + +export const DataPlaneAuthOptions: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DataPlaneAuthOptions", + modelProperties: { + apiKeyOnly: { + serializedName: "apiKeyOnly", + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } + }, + aadOrApiKey: { + serializedName: "aadOrApiKey", + type: { + name: "Composite", + className: "DataPlaneAadOrApiKeyAuthOption" + } + } + } + } +}; + +export const DataPlaneAadOrApiKeyAuthOption: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DataPlaneAadOrApiKeyAuthOption", + modelProperties: { + aadAuthFailureMode: { + serializedName: "aadAuthFailureMode", + type: { + name: "Enum", + allowedValues: ["http403", "http401WithBearerChallenge"] + } + } + } + } +}; + export const PrivateEndpointConnectionProperties: coreClient.CompositeMapper = { type: { name: "Composite", @@ -282,6 +345,18 @@ export const PrivateEndpointConnectionProperties: coreClient.CompositeMapper = { className: "PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState" } + }, + groupId: { + serializedName: "groupId", + type: { + name: "String" + } + }, + provisioningState: { + serializedName: "provisioningState", + type: { + name: "String" + } } } } @@ -919,6 +994,27 @@ export const SearchServiceUpdate: coreClient.CompositeMapper = { className: "NetworkRuleSet" } }, + encryptionWithCmk: { + serializedName: "properties.encryptionWithCmk", + type: { + name: "Composite", + className: "EncryptionWithCmk" + } + }, + disableLocalAuth: { + serializedName: "properties.disableLocalAuth", + nullable: true, + type: { + name: "Boolean" + } + }, + authOptions: { + serializedName: "properties.authOptions", + type: { + name: "Composite", + className: "DataPlaneAuthOptions" + } + }, privateEndpointConnections: { serializedName: "properties.privateEndpointConnections", readOnly: true, @@ -1061,6 +1157,27 @@ export const SearchService: coreClient.CompositeMapper = { className: "NetworkRuleSet" } }, + encryptionWithCmk: { + serializedName: "properties.encryptionWithCmk", + type: { + name: "Composite", + className: "EncryptionWithCmk" + } + }, + disableLocalAuth: { + serializedName: "properties.disableLocalAuth", + nullable: true, + type: { + name: "Boolean" + } + }, + authOptions: { + serializedName: "properties.authOptions", + type: { + name: "Composite", + className: "DataPlaneAuthOptions" + } + }, privateEndpointConnections: { serializedName: "properties.privateEndpointConnections", readOnly: true, diff --git a/sdk/search/arm-search/src/models/parameters.ts b/sdk/search/arm-search/src/models/parameters.ts index 95860ef47819..ce3d455016e2 100644 --- a/sdk/search/arm-search/src/models/parameters.ts +++ b/sdk/search/arm-search/src/models/parameters.ts @@ -46,7 +46,7 @@ export const $host: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2020-08-01", + defaultValue: "2022-09-01", isConstant: true, serializedName: "api-version", type: { diff --git a/sdk/search/arm-search/src/operations/services.ts b/sdk/search/arm-search/src/operations/services.ts index b2e8e2b395b5..393aa8a5e9b9 100644 --- a/sdk/search/arm-search/src/operations/services.ts +++ b/sdk/search/arm-search/src/operations/services.ts @@ -13,8 +13,12 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { SearchManagementClient } from "../searchManagementClient"; -import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; -import { LroImpl } from "../lroImpl"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; import { SearchService, ServicesListByResourceGroupNextOptionalParams, @@ -51,7 +55,7 @@ export class ServicesImpl implements Services { } /** - * Gets a list of all search services in the given resource group. + * Gets a list of all Search services 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 options The options parameters. @@ -121,7 +125,7 @@ export class ServicesImpl implements Services { } /** - * Gets a list of all search services in the given subscription. + * Gets a list of all Search services in the given subscription. * @param options The options parameters. */ public listBySubscription( @@ -194,8 +198,8 @@ export class ServicesImpl implements Services { service: SearchService, options?: ServicesCreateOrUpdateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, ServicesCreateOrUpdateResponse > > { @@ -205,7 +209,7 @@ export class ServicesImpl implements Services { ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -238,13 +242,16 @@ export class ServicesImpl implements Services { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, searchServiceName, service, options }, - createOrUpdateOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, searchServiceName, service, options }, + spec: createOrUpdateOperationSpec + }); + const poller = await createHttpPoller< + ServicesCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); await poller.poll(); @@ -339,7 +346,7 @@ export class ServicesImpl implements Services { } /** - * Gets a list of all search services in the given resource group. + * Gets a list of all Search services 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 options The options parameters. @@ -355,7 +362,7 @@ export class ServicesImpl implements Services { } /** - * Gets a list of all search services in the given subscription. + * Gets a list of all Search services in the given subscription. * @param options The options parameters. */ private _listBySubscription( diff --git a/sdk/search/arm-search/src/operations/sharedPrivateLinkResources.ts b/sdk/search/arm-search/src/operations/sharedPrivateLinkResources.ts index d72557fd58e8..68fcb6ae4998 100644 --- a/sdk/search/arm-search/src/operations/sharedPrivateLinkResources.ts +++ b/sdk/search/arm-search/src/operations/sharedPrivateLinkResources.ts @@ -13,8 +13,12 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { SearchManagementClient } from "../searchManagementClient"; -import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; -import { LroImpl } from "../lroImpl"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; import { SharedPrivateLinkResource, SharedPrivateLinkResourcesListByServiceNextOptionalParams, @@ -148,8 +152,8 @@ export class SharedPrivateLinkResourcesImpl sharedPrivateLinkResource: SharedPrivateLinkResource, options?: SharedPrivateLinkResourcesCreateOrUpdateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, SharedPrivateLinkResourcesCreateOrUpdateResponse > > { @@ -159,7 +163,7 @@ export class SharedPrivateLinkResourcesImpl ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -192,21 +196,24 @@ export class SharedPrivateLinkResourcesImpl }; }; - const lro = new LroImpl( - sendOperation, - { + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, searchServiceName, sharedPrivateLinkResourceName, sharedPrivateLinkResource, options }, - createOrUpdateOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + spec: createOrUpdateOperationSpec + }); + const poller = await createHttpPoller< + SharedPrivateLinkResourcesCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "azure-async-operation" + resourceLocationConfig: "azure-async-operation" }); await poller.poll(); return poller; @@ -285,14 +292,14 @@ export class SharedPrivateLinkResourcesImpl searchServiceName: string, sharedPrivateLinkResourceName: string, options?: SharedPrivateLinkResourcesDeleteOptionalParams - ): Promise, void>> { + ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -325,20 +332,20 @@ export class SharedPrivateLinkResourcesImpl }; }; - const lro = new LroImpl( - sendOperation, - { + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, searchServiceName, sharedPrivateLinkResourceName, options }, - deleteOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "azure-async-operation" + resourceLocationConfig: "azure-async-operation" }); await poller.poll(); return poller; diff --git a/sdk/search/arm-search/src/operationsInterfaces/services.ts b/sdk/search/arm-search/src/operationsInterfaces/services.ts index 68b1b3f3b6cb..d681f4434bba 100644 --- a/sdk/search/arm-search/src/operationsInterfaces/services.ts +++ b/sdk/search/arm-search/src/operationsInterfaces/services.ts @@ -7,7 +7,7 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { SearchService, ServicesListByResourceGroupOptionalParams, @@ -28,7 +28,7 @@ import { /** Interface representing a Services. */ export interface Services { /** - * Gets a list of all search services in the given resource group. + * Gets a list of all Search services 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 options The options parameters. @@ -38,7 +38,7 @@ export interface Services { options?: ServicesListByResourceGroupOptionalParams ): PagedAsyncIterableIterator; /** - * Gets a list of all search services in the given subscription. + * Gets a list of all Search services in the given subscription. * @param options The options parameters. */ listBySubscription( @@ -64,8 +64,8 @@ export interface Services { service: SearchService, options?: ServicesCreateOrUpdateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, ServicesCreateOrUpdateResponse > >; diff --git a/sdk/search/arm-search/src/operationsInterfaces/sharedPrivateLinkResources.ts b/sdk/search/arm-search/src/operationsInterfaces/sharedPrivateLinkResources.ts index e1b02319ebf3..f5d34e9b4015 100644 --- a/sdk/search/arm-search/src/operationsInterfaces/sharedPrivateLinkResources.ts +++ b/sdk/search/arm-search/src/operationsInterfaces/sharedPrivateLinkResources.ts @@ -7,7 +7,7 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { SharedPrivateLinkResource, SharedPrivateLinkResourcesListByServiceOptionalParams, @@ -54,8 +54,8 @@ export interface SharedPrivateLinkResources { sharedPrivateLinkResource: SharedPrivateLinkResource, options?: SharedPrivateLinkResourcesCreateOrUpdateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, SharedPrivateLinkResourcesCreateOrUpdateResponse > >; @@ -111,7 +111,7 @@ export interface SharedPrivateLinkResources { searchServiceName: string, sharedPrivateLinkResourceName: string, options?: SharedPrivateLinkResourcesDeleteOptionalParams - ): Promise, void>>; + ): 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 diff --git a/sdk/search/arm-search/src/searchManagementClient.ts b/sdk/search/arm-search/src/searchManagementClient.ts index 53cfba6938ad..6c9ca90bcde4 100644 --- a/sdk/search/arm-search/src/searchManagementClient.ts +++ b/sdk/search/arm-search/src/searchManagementClient.ts @@ -67,7 +67,7 @@ export class SearchManagementClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-search/3.1.1`; + const packageDetails = `azsdk-js-arm-search/3.2.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -120,7 +120,7 @@ export class SearchManagementClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2020-08-01"; + this.apiVersion = options.apiVersion || "2022-09-01"; this.operations = new OperationsImpl(this); this.adminKeys = new AdminKeysImpl(this); this.queryKeys = new QueryKeysImpl(this); diff --git a/sdk/search/arm-search/test/sampleTest.ts b/sdk/search/arm-search/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/search/arm-search/test/sampleTest.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. + */ + +import { + Recorder, + RecorderStartOptions, + env +} from "@azure-tools/test-recorder"; +import { assert } from "chai"; +import { Context } from "mocha"; + +const replaceableVariables: Record = { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function(this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/search/arm-search/tsconfig.json b/sdk/search/arm-search/tsconfig.json index e1056465e215..3e6ae96443f3 100644 --- a/sdk/search/arm-search/tsconfig.json +++ b/sdk/search/arm-search/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-search": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"