From a61d173642e50f0d9f040820f9baf1e3b44882c5 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 26 Feb 2019 12:33:16 -0800 Subject: [PATCH] Generated from 0bfb44bb226810a4151f6d0ec438bfa3a7ab6cf5 (#4760) Update search.json Rename example reference name --- lib/services/searchManagement/LICENSE.txt | 2 +- lib/services/searchManagement/README.md | 29 +- .../lib/models/adminKeyResult.js | 6 +- .../lib/models/checkNameAvailabilityInput.js | 8 +- .../lib/models/checkNameAvailabilityOutput.js | 12 +- .../searchManagement/lib/models/identity.js | 4 +- .../searchManagement/lib/models/index.d.ts | 341 ++++++++---------- .../searchManagement/lib/models/operation.js | 15 +- .../lib/models/operationDisplay.js | 8 +- .../lib/models/operationListResult.js | 4 +- .../searchManagement/lib/models/queryKey.js | 4 +- .../searchManagement/lib/models/resource.js | 20 +- .../models/searchManagementRequestOptions.js | 2 +- .../lib/models/searchService.js | 28 +- .../searchManagement/lib/models/sku.js | 2 +- .../lib/operations/adminKeys.js | 6 +- .../lib/operations/index.d.ts | 66 ++++ .../lib/operations/queryKeys.js | 9 +- .../lib/operations/services.js | 271 +++++++++++++- .../lib/searchManagementClient.d.ts | 6 +- .../lib/searchManagementClient.js | 6 +- lib/services/searchManagement/package.json | 6 +- 22 files changed, 562 insertions(+), 293 deletions(-) diff --git a/lib/services/searchManagement/LICENSE.txt b/lib/services/searchManagement/LICENSE.txt index 5431ba98b9..8f3d856145 100644 --- a/lib/services/searchManagement/LICENSE.txt +++ b/lib/services/searchManagement/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2018 Microsoft +Copyright (c) 2019 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/lib/services/searchManagement/README.md b/lib/services/searchManagement/README.md index 04ca7f4c65..6f910439be 100644 --- a/lib/services/searchManagement/README.md +++ b/lib/services/searchManagement/README.md @@ -3,38 +3,41 @@ uid: azure-arm-search summary: *content --- -# Microsoft Azure SDK for Node.js - SearchManagementClient +**This SDK will be deprecated next year and will be replaced by a new TypeScript-based isomorphic SDK (found at https://github.com/Azure/azure-sdk-for-js) which works on Node.js and browsers.** +## Microsoft Azure SDK for Node.js - SearchManagementClient + This project provides a Node.js package for accessing Azure. Right now it supports: - **Node.js version 6.x.x or higher** -## Features +### Features -## How to Install +### How to Install ```bash npm install azure-arm-search ``` -## How to use +### How to use -### Authentication, client creation and list operations as an example. +#### Authentication, client creation, and list operations as an example. ```javascript const msRestAzure = require("ms-rest-azure"); const SearchManagementClient = require("azure-arm-search"); msRestAzure.interactiveLogin().then((creds) => { - const subscriptionId = ""; - const client = new SearchManagementClient(creds, subscriptionId); - return client.operations.list().then((result) => { - console.log("The result is:"); - console.log(result); - }); + const subscriptionId = ""; + const client = new SearchManagementClient(creds, subscriptionId); + + return client.operations.list().then((result) => { + console.log("The result is:"); + console.log(result); + }); }).catch((err) => { console.log('An error occurred:'); console.dir(err, {depth: null, colors: true}); }); - -## Related projects +``` +### Related projects - [Microsoft Azure SDK for Node.js](https://github.com/Azure/azure-sdk-for-node) diff --git a/lib/services/searchManagement/lib/models/adminKeyResult.js b/lib/services/searchManagement/lib/models/adminKeyResult.js index 43a21932a0..242e7c4f3e 100644 --- a/lib/services/searchManagement/lib/models/adminKeyResult.js +++ b/lib/services/searchManagement/lib/models/adminKeyResult.js @@ -18,10 +18,10 @@ class AdminKeyResult { /** * Create a AdminKeyResult. - * @member {string} [primaryKey] The primary admin API key of the Search - * service. - * @member {string} [secondaryKey] The secondary admin API key of the Search + * @property {string} [primaryKey] The primary admin API key of the Search * service. + * @property {string} [secondaryKey] The secondary admin API key of the + * Search service. */ constructor() { } diff --git a/lib/services/searchManagement/lib/models/checkNameAvailabilityInput.js b/lib/services/searchManagement/lib/models/checkNameAvailabilityInput.js index fc18a86e18..1b2faa854d 100644 --- a/lib/services/searchManagement/lib/models/checkNameAvailabilityInput.js +++ b/lib/services/searchManagement/lib/models/checkNameAvailabilityInput.js @@ -17,10 +17,10 @@ class CheckNameAvailabilityInput { /** * Create a CheckNameAvailabilityInput. - * @member {string} name The Search service name to validate. 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. + * @property {string} name The Search service name to validate. 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. */ constructor() { } diff --git a/lib/services/searchManagement/lib/models/checkNameAvailabilityOutput.js b/lib/services/searchManagement/lib/models/checkNameAvailabilityOutput.js index 2209743297..3d03d7d4c6 100644 --- a/lib/services/searchManagement/lib/models/checkNameAvailabilityOutput.js +++ b/lib/services/searchManagement/lib/models/checkNameAvailabilityOutput.js @@ -17,16 +17,16 @@ class CheckNameAvailabilityOutput { /** * Create a CheckNameAvailabilityOutput. - * @member {boolean} [isNameAvailable] A value indicating whether the name is - * available. - * @member {string} [reason] The reason why the name is not available. + * @property {boolean} [isNameAvailable] A value indicating whether the name + * is available. + * @property {string} [reason] The reason why the name is not available. * 'Invalid' indicates the name provided does not match the naming * requirements (incorrect length, unsupported characters, etc.). * 'AlreadyExists' indicates that the name is already in use and is therefore * unavailable. Possible values include: 'Invalid', 'AlreadyExists' - * @member {string} [message] A message that explains why the name is invalid - * and provides resource naming requirements. Available only if 'Invalid' is - * returned in the 'reason' property. + * @property {string} [message] A message that explains why the name is + * invalid and provides resource naming requirements. Available only if + * 'Invalid' is returned in the 'reason' property. */ constructor() { } diff --git a/lib/services/searchManagement/lib/models/identity.js b/lib/services/searchManagement/lib/models/identity.js index 334b53a81b..d346e75a54 100644 --- a/lib/services/searchManagement/lib/models/identity.js +++ b/lib/services/searchManagement/lib/models/identity.js @@ -17,8 +17,8 @@ class Identity { /** * Create a Identity. - * @member {string} [principalId] The principal ID of resource identity. - * @member {string} [tenantId] The tenant ID of resource. + * @property {string} [principalId] The principal ID of resource identity. + * @property {string} [tenantId] The tenant ID of resource. */ constructor() { } diff --git a/lib/services/searchManagement/lib/models/index.d.ts b/lib/services/searchManagement/lib/models/index.d.ts index dc0aad4d23..1af3c0bb2f 100644 --- a/lib/services/searchManagement/lib/models/index.d.ts +++ b/lib/services/searchManagement/lib/models/index.d.ts @@ -1,310 +1,271 @@ /* * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Licensed under the MIT License. See License.txt in the project root for license information. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { BaseResource } from 'ms-rest-azure'; -import { CloudError } from 'ms-rest-azure'; -import * as moment from 'moment'; +import { BaseResource, CloudError } from "ms-rest-azure"; +import * as moment from "moment"; -export { BaseResource } from 'ms-rest-azure'; -export { CloudError } from 'ms-rest-azure'; +export { + BaseResource, + CloudError +}; /** - * @class - * Initializes a new instance of the CheckNameAvailabilityInput class. - * @constructor * Input of check name availability API. - * - * @member {string} name The Search service name to validate. 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. */ export interface CheckNameAvailabilityInput { + /** + * The Search service name to validate. 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. + */ name: string; } /** - * @class - * Initializes a new instance of the CheckNameAvailabilityOutput class. - * @constructor * Output of check name availability API. - * - * @member {boolean} [isNameAvailable] A value indicating whether the name is - * available. - * @member {string} [reason] The reason why the name is not available. - * 'Invalid' indicates the name provided does not match the naming requirements - * (incorrect length, unsupported characters, etc.). 'AlreadyExists' indicates - * that the name is already in use and is therefore unavailable. Possible - * values include: 'Invalid', 'AlreadyExists' - * @member {string} [message] A message that explains why the name is invalid - * and provides resource naming requirements. Available only if 'Invalid' is - * returned in the 'reason' property. */ export interface CheckNameAvailabilityOutput { + /** + * A value indicating whether the name is available. + */ readonly isNameAvailable?: boolean; + /** + * The reason why the name is not available. 'Invalid' indicates the name provided does not match + * the naming requirements (incorrect length, unsupported characters, etc.). 'AlreadyExists' + * indicates that the name is already in use and is therefore unavailable. Possible values + * include: 'Invalid', 'AlreadyExists' + */ readonly reason?: string; + /** + * A message that explains why the name is invalid and provides resource naming requirements. + * Available only if 'Invalid' is returned in the 'reason' property. + */ readonly message?: string; } /** - * @class - * Initializes a new instance of the AdminKeyResult class. - * @constructor - * Response containing the primary and secondary admin API keys for a given - * Azure Search service. - * - * @member {string} [primaryKey] The primary admin API key of the Search - * service. - * @member {string} [secondaryKey] The secondary admin API key of the Search - * service. + * Response containing the primary and secondary admin API keys for a given Azure Search service. */ export interface AdminKeyResult { + /** + * The primary admin API key of the Search service. + */ readonly primaryKey?: string; + /** + * The secondary admin API key of the Search service. + */ readonly secondaryKey?: string; } /** - * @class - * Initializes a new instance of the QueryKey class. - * @constructor - * Describes an API key for a given Azure Search service that has permissions - * for query operations only. - * - * @member {string} [name] The name of the query API key; may be empty. - * @member {string} [key] The value of the query API key. + * Describes an API key for a given Azure Search service that has permissions for query operations + * only. */ export interface QueryKey { + /** + * The name of the query API key; may be empty. + */ readonly name?: string; + /** + * The value of the query API key. + */ readonly key?: string; } /** - * @class - * Initializes a new instance of the Sku class. - * @constructor - * Defines the SKU of an Azure Search Service, which determines price tier and - * capacity limits. - * - * @member {string} [name] 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': Offers maximum capacity per search unit 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'). Possible values - * include: 'free', 'basic', 'standard', 'standard2', 'standard3' + * Defines the SKU of an Azure Search Service, which determines price tier 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': Offers maximum capacity per search unit 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'). Possible values include: 'free', 'basic', 'standard', 'standard2', + * 'standard3' + */ name?: string; } /** - * @class - * Initializes a new instance of the Resource class. - * @constructor * Base type for all Azure resources. - * - * @member {string} [id] The ID of the resource. This can be used with the - * Azure Resource Manager to link resources together. - * @member {string} [name] The name of the resource. - * @member {string} [type] The resource type. - * @member {string} [location] 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. - * @member {object} [tags] Tags to help categorize the resource in the Azure - * portal. - * @member {object} [identity] The identity of the resource. - * @member {string} [identity.principalId] The principal ID of resource - * identity. - * @member {string} [identity.tenantId] The tenant ID of resource. */ export interface Resource extends BaseResource { + /** + * The ID of the resource. This can be used with the Azure Resource Manager to link resources + * together. + */ readonly id?: string; + /** + * The name of the resource. + */ readonly name?: string; + /** + * The resource type. + */ readonly type?: string; + /** + * 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. + */ identity?: Identity; } /** - * @class - * Initializes a new instance of the SearchService class. - * @constructor * Describes an Azure Search service and its current state. - * - * @member {number} [replicaCount] 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. Default value: 1 . - * @member {number} [partitionCount] The number of partitions in the Search - * service; if specified, it can be 1, 2, 3, 4, 6, or 12. Values greater than 1 - * are only valid for standard SKUs. For 'standard3' services with hostingMode - * set to 'highDensity', the allowed values are between 1 and 3. Default value: - * 1 . - * @member {string} [hostingMode] Applicable only for the standard3 SKU. You - * can set this property to enable up to 3 high density partitions that allow - * up to 1000 indexes, which is much higher than the maximum indexes allowed - * for any other SKU. For the standard3 SKU, the value is either 'default' or - * 'highDensity'. For all other SKUs, this value must be 'default'. Possible - * values include: 'default', 'highDensity'. Default value: 'default' . - * @member {string} [status] 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 Search team is actively investigating the underlying - * issue. Dedicated services in these states are still chargeable based on the - * number of search units provisioned. Possible values include: 'running', - * 'provisioning', 'deleting', 'degraded', 'disabled', 'error' - * @member {string} [statusDetails] The details of the Search service status. - * @member {string} [provisioningState] The state of the last provisioning - * operation performed on the Search service. Provisioning is an intermediate - * state that occurs while service capacity is being established. After - * capacity is set up, provisioningState changes to either 'succeeded' or - * 'failed'. Client applications can poll provisioning status (the recommended - * polling interval is from 30 seconds to one minute) by using the Get Search - * Service operation to see when an operation is completed. If you are using - * the free service, this value tends to come back as 'succeeded' directly in - * the call to Create Search service. This is because the free service uses - * capacity that is already set up. Possible values include: 'succeeded', - * 'provisioning', 'failed' - * @member {object} [sku] The SKU of the Search Service, which determines price - * tier and capacity limits. This property is required when creating a new - * Search Service. - * @member {string} [sku.name] 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': Offers maximum capacity per search unit 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'). Possible values - * include: 'free', 'basic', 'standard', 'standard2', 'standard3' */ export interface SearchService extends Resource { + /** + * 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; + /** + * The number of partitions in the Search service; if specified, it can be 1, 2, 3, 4, 6, or 12. + * Values greater than 1 are only valid for standard SKUs. For 'standard3' services with + * hostingMode set to 'highDensity', the allowed values are between 1 and 3. + */ partitionCount?: number; + /** + * Applicable only for the standard3 SKU. You can set this property to enable up to 3 high + * density partitions that allow up to 1000 indexes, which is much higher than the maximum + * indexes allowed for any other SKU. For the standard3 SKU, the value is either 'default' or + * 'highDensity'. For all other SKUs, this value must be 'default'. Possible values include: + * 'default', 'highDensity' + */ hostingMode?: string; + /** + * 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 Search team is + * actively investigating the underlying issue. Dedicated services in these states are still + * chargeable based on the number of search units provisioned. Possible values include: + * 'running', 'provisioning', 'deleting', 'degraded', 'disabled', 'error' + */ readonly status?: string; + /** + * The details of the Search service status. + */ readonly statusDetails?: string; + /** + * The state of the last provisioning operation performed on the Search service. Provisioning is + * an intermediate state that occurs while service capacity is being established. After capacity + * is set up, provisioningState changes to either 'succeeded' or 'failed'. Client applications + * can poll provisioning status (the recommended polling interval is from 30 seconds to one + * minute) by using the Get Search Service operation to see when an operation is completed. If + * you are using the free service, this value tends to come back as 'succeeded' directly in the + * call to Create Search service. This is because the free service uses capacity that is already + * set up. Possible values include: 'succeeded', 'provisioning', 'failed' + */ readonly provisioningState?: string; + /** + * 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; } /** - * @class - * Initializes a new instance of the Identity class. - * @constructor * Identity for the resource. - * - * @member {string} [principalId] The principal ID of resource identity. - * @member {string} [tenantId] The tenant ID of resource. */ export interface Identity { + /** + * The principal ID of resource identity. + */ readonly principalId?: string; + /** + * The tenant ID of resource. + */ readonly tenantId?: string; } /** - * @class - * Initializes a new instance of the OperationDisplay class. - * @constructor * The object that describes the operation. - * - * @member {string} [provider] The friendly name of the resource provider. - * @member {string} [operation] The operation type: read, write, delete, - * listKeys/action, etc. - * @member {string} [resource] The resource type on which the operation is - * performed. - * @member {string} [description] The friendly name of the operation. */ export interface OperationDisplay { + /** + * The friendly name of the resource provider. + */ readonly provider?: string; + /** + * The operation type: read, write, delete, listKeys/action, etc. + */ readonly operation?: string; + /** + * The resource type on which the operation is performed. + */ readonly resource?: string; + /** + * The friendly name of the operation. + */ readonly description?: string; } /** - * @class - * Initializes a new instance of the Operation class. - * @constructor * Describes a REST API operation. - * - * @member {string} [name] The name of the operation. This name is of the form - * {provider}/{resource}/{operation}. - * @member {object} [display] The object that describes the operation. - * @member {string} [display.provider] The friendly name of the resource - * provider. - * @member {string} [display.operation] The operation type: read, write, - * delete, listKeys/action, etc. - * @member {string} [display.resource] The resource type on which the operation - * is performed. - * @member {string} [display.description] The friendly name of the operation. */ export interface Operation { + /** + * The name of the operation. This name is of the form {provider}/{resource}/{operation}. + */ readonly name?: string; + /** + * The object that describes the operation. + */ readonly display?: OperationDisplay; } /** - * @class - * Initializes a new instance of the SearchManagementRequestOptions class. - * @constructor * Additional parameters for a set of operations. - * - * @member {uuid} [clientRequestId] A client-generated GUID value that - * identifies this request. If specified, this will be included in response - * information as a way to track the request. */ export interface SearchManagementRequestOptions { + /** + * A client-generated GUID value that identifies this request. If specified, this will be + * included in response information as a way to track the request. + */ clientRequestId?: string; } - /** - * @class - * Initializes a new instance of the OperationListResult class. - * @constructor - * 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. - * - * @member {string} [nextLink] The URL to get the next set of operation list - * results, if any. + * 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 extends Array { + /** + * The URL to get the next set of operation list results, if any. + */ readonly nextLink?: string; } /** - * @class - * Initializes a new instance of the ListQueryKeysResult class. - * @constructor * Response containing the query API keys for a given Azure Search service. - * */ export interface ListQueryKeysResult extends Array { } /** - * @class - * Initializes a new instance of the SearchServiceListResult class. - * @constructor * Response containing a list of Azure Search services. - * */ export interface SearchServiceListResult extends Array { } diff --git a/lib/services/searchManagement/lib/models/operation.js b/lib/services/searchManagement/lib/models/operation.js index d342a4ce1a..78a86c463a 100644 --- a/lib/services/searchManagement/lib/models/operation.js +++ b/lib/services/searchManagement/lib/models/operation.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Describes a REST API operation. * @@ -19,16 +17,17 @@ const models = require('./index'); class Operation { /** * Create a Operation. - * @member {string} [name] The name of the operation. This name is of the + * @property {string} [name] The name of the operation. This name is of the * form {provider}/{resource}/{operation}. - * @member {object} [display] The object that describes the operation. - * @member {string} [display.provider] The friendly name of the resource + * @property {object} [display] The object that describes the operation. + * @property {string} [display.provider] The friendly name of the resource * provider. - * @member {string} [display.operation] The operation type: read, write, + * @property {string} [display.operation] The operation type: read, write, * delete, listKeys/action, etc. - * @member {string} [display.resource] The resource type on which the + * @property {string} [display.resource] The resource type on which the * operation is performed. - * @member {string} [display.description] The friendly name of the operation. + * @property {string} [display.description] The friendly name of the + * operation. */ constructor() { } diff --git a/lib/services/searchManagement/lib/models/operationDisplay.js b/lib/services/searchManagement/lib/models/operationDisplay.js index 06f752fe3f..dd0d934af1 100644 --- a/lib/services/searchManagement/lib/models/operationDisplay.js +++ b/lib/services/searchManagement/lib/models/operationDisplay.js @@ -17,12 +17,12 @@ class OperationDisplay { /** * Create a OperationDisplay. - * @member {string} [provider] The friendly name of the resource provider. - * @member {string} [operation] The operation type: read, write, delete, + * @property {string} [provider] The friendly name of the resource provider. + * @property {string} [operation] The operation type: read, write, delete, * listKeys/action, etc. - * @member {string} [resource] The resource type on which the operation is + * @property {string} [resource] The resource type on which the operation is * performed. - * @member {string} [description] The friendly name of the operation. + * @property {string} [description] The friendly name of the operation. */ constructor() { } diff --git a/lib/services/searchManagement/lib/models/operationListResult.js b/lib/services/searchManagement/lib/models/operationListResult.js index 055dfd72eb..3d149df809 100644 --- a/lib/services/searchManagement/lib/models/operationListResult.js +++ b/lib/services/searchManagement/lib/models/operationListResult.js @@ -17,8 +17,8 @@ class OperationListResult extends Array { /** * Create a OperationListResult. - * @member {string} [nextLink] The URL to get the next set of operation list - * results, if any. + * @property {string} [nextLink] The URL to get the next set of operation + * list results, if any. */ constructor() { super(); diff --git a/lib/services/searchManagement/lib/models/queryKey.js b/lib/services/searchManagement/lib/models/queryKey.js index bd5a0511f4..8ba85f6617 100644 --- a/lib/services/searchManagement/lib/models/queryKey.js +++ b/lib/services/searchManagement/lib/models/queryKey.js @@ -18,8 +18,8 @@ class QueryKey { /** * Create a QueryKey. - * @member {string} [name] The name of the query API key; may be empty. - * @member {string} [key] The value of the query API key. + * @property {string} [name] The name of the query API key; may be empty. + * @property {string} [key] The value of the query API key. */ constructor() { } diff --git a/lib/services/searchManagement/lib/models/resource.js b/lib/services/searchManagement/lib/models/resource.js index 126c5de0cd..b415b83326 100644 --- a/lib/services/searchManagement/lib/models/resource.js +++ b/lib/services/searchManagement/lib/models/resource.js @@ -20,20 +20,20 @@ const models = require('./index'); class Resource extends models['BaseResource'] { /** * Create a Resource. - * @member {string} [id] The ID of the resource. This can be used with the + * @property {string} [id] The ID of the resource. This can be used with the * Azure Resource Manager to link resources together. - * @member {string} [name] The name of the resource. - * @member {string} [type] The resource type. - * @member {string} [location] The geographic location of the resource. This - * must be one of the supported and registered Azure Geo Regions (for + * @property {string} [name] The name of the resource. + * @property {string} [type] The resource type. + * @property {string} [location] 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. - * @member {object} [tags] Tags to help categorize the resource in the Azure - * portal. - * @member {object} [identity] The identity of the resource. - * @member {string} [identity.principalId] The principal ID of resource + * @property {object} [tags] Tags to help categorize the resource in the + * Azure portal. + * @property {object} [identity] The identity of the resource. + * @property {string} [identity.principalId] The principal ID of resource * identity. - * @member {string} [identity.tenantId] The tenant ID of resource. + * @property {string} [identity.tenantId] The tenant ID of resource. */ constructor() { super(); diff --git a/lib/services/searchManagement/lib/models/searchManagementRequestOptions.js b/lib/services/searchManagement/lib/models/searchManagementRequestOptions.js index 7827b8eada..0978563365 100644 --- a/lib/services/searchManagement/lib/models/searchManagementRequestOptions.js +++ b/lib/services/searchManagement/lib/models/searchManagementRequestOptions.js @@ -17,7 +17,7 @@ class SearchManagementRequestOptions { /** * Create a SearchManagementRequestOptions. - * @member {uuid} [clientRequestId] A client-generated GUID value that + * @property {uuid} [clientRequestId] A client-generated GUID value that * identifies this request. If specified, this will be included in response * information as a way to track the request. */ diff --git a/lib/services/searchManagement/lib/models/searchService.js b/lib/services/searchManagement/lib/models/searchService.js index a44f18dab2..56859339c4 100644 --- a/lib/services/searchManagement/lib/models/searchService.js +++ b/lib/services/searchManagement/lib/models/searchService.js @@ -20,22 +20,23 @@ const models = require('./index'); class SearchService extends models['Resource'] { /** * Create a SearchService. - * @member {number} [replicaCount] The number of replicas in the Search + * @property {number} [replicaCount] 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. Default value: 1 * . - * @member {number} [partitionCount] The number of partitions in the Search + * @property {number} [partitionCount] The number of partitions in the Search * service; if specified, it can be 1, 2, 3, 4, 6, or 12. Values greater than * 1 are only valid for standard SKUs. For 'standard3' services with * hostingMode set to 'highDensity', the allowed values are between 1 and 3. * Default value: 1 . - * @member {string} [hostingMode] Applicable only for the standard3 SKU. You - * can set this property to enable up to 3 high density partitions that allow - * up to 1000 indexes, which is much higher than the maximum indexes allowed - * for any other SKU. For the standard3 SKU, the value is either 'default' or - * 'highDensity'. For all other SKUs, this value must be 'default'. Possible - * values include: 'default', 'highDensity'. Default value: 'default' . - * @member {string} [status] The status of the Search service. Possible + * @property {string} [hostingMode] Applicable only for the standard3 SKU. + * You can set this property to enable up to 3 high density partitions that + * allow up to 1000 indexes, which is much higher than the maximum indexes + * allowed for any other SKU. For the standard3 SKU, the value is either + * 'default' or 'highDensity'. For all other SKUs, this value must be + * 'default'. Possible values include: 'default', 'highDensity'. Default + * value: 'default' . + * @property {string} [status] 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 @@ -50,8 +51,9 @@ class SearchService extends models['Resource'] { * still chargeable based on the number of search units provisioned. Possible * values include: 'running', 'provisioning', 'deleting', 'degraded', * 'disabled', 'error' - * @member {string} [statusDetails] The details of the Search service status. - * @member {string} [provisioningState] The state of the last provisioning + * @property {string} [statusDetails] The details of the Search service + * status. + * @property {string} [provisioningState] The state of the last provisioning * operation performed on the Search service. Provisioning is an intermediate * state that occurs while service capacity is being established. After * capacity is set up, provisioningState changes to either 'succeeded' or @@ -62,10 +64,10 @@ class SearchService extends models['Resource'] { * 'succeeded' directly in the call to Create Search service. This is because * the free service uses capacity that is already set up. Possible values * include: 'succeeded', 'provisioning', 'failed' - * @member {object} [sku] The SKU of the Search Service, which determines + * @property {object} [sku] The SKU of the Search Service, which determines * price tier and capacity limits. This property is required when creating a * new Search Service. - * @member {string} [sku.name] The SKU of the Search service. Valid values + * @property {string} [sku.name] 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 diff --git a/lib/services/searchManagement/lib/models/sku.js b/lib/services/searchManagement/lib/models/sku.js index aed03203ec..b9328ce5eb 100644 --- a/lib/services/searchManagement/lib/models/sku.js +++ b/lib/services/searchManagement/lib/models/sku.js @@ -18,7 +18,7 @@ class Sku { /** * Create a Sku. - * @member {string} [name] The SKU of the Search service. Valid values + * @property {string} [name] 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 diff --git a/lib/services/searchManagement/lib/operations/adminKeys.js b/lib/services/searchManagement/lib/operations/adminKeys.js index 1cacf8c989..aa8c577914 100644 --- a/lib/services/searchManagement/lib/operations/adminKeys.js +++ b/lib/services/searchManagement/lib/operations/adminKeys.js @@ -83,8 +83,7 @@ function _get(resourceGroupName, searchServiceName, options, callback) { } let clientRequestId; try { - if (searchManagementRequestOptions !== null && searchManagementRequestOptions !== undefined) - { + if (searchManagementRequestOptions !== null && searchManagementRequestOptions !== undefined) { clientRequestId = searchManagementRequestOptions.clientRequestId; if (clientRequestId !== null && clientRequestId !== undefined && !(typeof clientRequestId.valueOf() === 'string' && msRest.isValidUuid(clientRequestId))) { throw new Error('clientRequestId must be of type string and must be a valid uuid.'); @@ -267,8 +266,7 @@ function _regenerate(resourceGroupName, searchServiceName, keyKind, options, cal } let clientRequestId; try { - if (searchManagementRequestOptions !== null && searchManagementRequestOptions !== undefined) - { + if (searchManagementRequestOptions !== null && searchManagementRequestOptions !== undefined) { clientRequestId = searchManagementRequestOptions.clientRequestId; if (clientRequestId !== null && clientRequestId !== undefined && !(typeof clientRequestId.valueOf() === 'string' && msRest.isValidUuid(clientRequestId))) { throw new Error('clientRequestId must be of type string and must be a valid uuid.'); diff --git a/lib/services/searchManagement/lib/operations/index.d.ts b/lib/services/searchManagement/lib/operations/index.d.ts index ccef8a88d1..98d1703d36 100644 --- a/lib/services/searchManagement/lib/operations/index.d.ts +++ b/lib/services/searchManagement/lib/operations/index.d.ts @@ -1094,6 +1094,72 @@ export interface Services { listByResourceGroup(resourceGroupName: string, options: { searchManagementRequestOptions? : models.SearchManagementRequestOptions, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** + * Gets a list of all Search services in the given subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.searchManagementRequestOptions] Additional + * parameters for the operation + * + * @param {uuid} [options.searchManagementRequestOptions.clientRequestId] A + * client-generated GUID value that identifies this request. If specified, this + * will be included in response information as a way to track the request. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listBySubscriptionWithHttpOperationResponse(options?: { searchManagementRequestOptions? : models.SearchManagementRequestOptions, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a list of all Search services in the given subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.searchManagementRequestOptions] Additional + * parameters for the operation + * + * @param {uuid} [options.searchManagementRequestOptions.clientRequestId] A + * client-generated GUID value that identifies this request. If specified, this + * will be included in response information as a way to track the request. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {SearchServiceListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {SearchServiceListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SearchServiceListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listBySubscription(options?: { searchManagementRequestOptions? : models.SearchManagementRequestOptions, customHeaders? : { [headerName: string]: string; } }): Promise; + listBySubscription(callback: ServiceCallback): void; + listBySubscription(options: { searchManagementRequestOptions? : models.SearchManagementRequestOptions, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * 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 diff --git a/lib/services/searchManagement/lib/operations/queryKeys.js b/lib/services/searchManagement/lib/operations/queryKeys.js index 79ca8cd3f4..ce0a4fc223 100644 --- a/lib/services/searchManagement/lib/operations/queryKeys.js +++ b/lib/services/searchManagement/lib/operations/queryKeys.js @@ -88,8 +88,7 @@ function _create(resourceGroupName, searchServiceName, name, options, callback) } let clientRequestId; try { - if (searchManagementRequestOptions !== null && searchManagementRequestOptions !== undefined) - { + if (searchManagementRequestOptions !== null && searchManagementRequestOptions !== undefined) { clientRequestId = searchManagementRequestOptions.clientRequestId; if (clientRequestId !== null && clientRequestId !== undefined && !(typeof clientRequestId.valueOf() === 'string' && msRest.isValidUuid(clientRequestId))) { throw new Error('clientRequestId must be of type string and must be a valid uuid.'); @@ -260,8 +259,7 @@ function _listBySearchService(resourceGroupName, searchServiceName, options, cal } let clientRequestId; try { - if (searchManagementRequestOptions !== null && searchManagementRequestOptions !== undefined) - { + if (searchManagementRequestOptions !== null && searchManagementRequestOptions !== undefined) { clientRequestId = searchManagementRequestOptions.clientRequestId; if (clientRequestId !== null && clientRequestId !== undefined && !(typeof clientRequestId.valueOf() === 'string' && msRest.isValidUuid(clientRequestId))) { throw new Error('clientRequestId must be of type string and must be a valid uuid.'); @@ -438,8 +436,7 @@ function _deleteMethod(resourceGroupName, searchServiceName, key, options, callb } let clientRequestId; try { - if (searchManagementRequestOptions !== null && searchManagementRequestOptions !== undefined) - { + if (searchManagementRequestOptions !== null && searchManagementRequestOptions !== undefined) { clientRequestId = searchManagementRequestOptions.clientRequestId; if (clientRequestId !== null && clientRequestId !== undefined && !(typeof clientRequestId.valueOf() === 'string' && msRest.isValidUuid(clientRequestId))) { throw new Error('clientRequestId must be of type string and must be a valid uuid.'); diff --git a/lib/services/searchManagement/lib/operations/services.js b/lib/services/searchManagement/lib/operations/services.js index 1267c1075c..a2d326f4c4 100644 --- a/lib/services/searchManagement/lib/operations/services.js +++ b/lib/services/searchManagement/lib/operations/services.js @@ -263,8 +263,7 @@ function _update(resourceGroupName, searchServiceName, service, options, callbac } let clientRequestId; try { - if (searchManagementRequestOptions !== null && searchManagementRequestOptions !== undefined) - { + if (searchManagementRequestOptions !== null && searchManagementRequestOptions !== undefined) { clientRequestId = searchManagementRequestOptions.clientRequestId; if (clientRequestId !== null && clientRequestId !== undefined && !(typeof clientRequestId.valueOf() === 'string' && msRest.isValidUuid(clientRequestId))) { throw new Error('clientRequestId must be of type string and must be a valid uuid.'); @@ -448,8 +447,7 @@ function _get(resourceGroupName, searchServiceName, options, callback) { } let clientRequestId; try { - if (searchManagementRequestOptions !== null && searchManagementRequestOptions !== undefined) - { + if (searchManagementRequestOptions !== null && searchManagementRequestOptions !== undefined) { clientRequestId = searchManagementRequestOptions.clientRequestId; if (clientRequestId !== null && clientRequestId !== undefined && !(typeof clientRequestId.valueOf() === 'string' && msRest.isValidUuid(clientRequestId))) { throw new Error('clientRequestId must be of type string and must be a valid uuid.'); @@ -619,8 +617,7 @@ function _deleteMethod(resourceGroupName, searchServiceName, options, callback) } let clientRequestId; try { - if (searchManagementRequestOptions !== null && searchManagementRequestOptions !== undefined) - { + if (searchManagementRequestOptions !== null && searchManagementRequestOptions !== undefined) { clientRequestId = searchManagementRequestOptions.clientRequestId; if (clientRequestId !== null && clientRequestId !== undefined && !(typeof clientRequestId.valueOf() === 'string' && msRest.isValidUuid(clientRequestId))) { throw new Error('clientRequestId must be of type string and must be a valid uuid.'); @@ -768,8 +765,7 @@ function _listByResourceGroup(resourceGroupName, options, callback) { } let clientRequestId; try { - if (searchManagementRequestOptions !== null && searchManagementRequestOptions !== undefined) - { + if (searchManagementRequestOptions !== null && searchManagementRequestOptions !== undefined) { clientRequestId = searchManagementRequestOptions.clientRequestId; if (clientRequestId !== null && clientRequestId !== undefined && !(typeof clientRequestId.valueOf() === 'string' && msRest.isValidUuid(clientRequestId))) { throw new Error('clientRequestId must be of type string and must be a valid uuid.'); @@ -870,6 +866,162 @@ function _listByResourceGroup(resourceGroupName, options, callback) { }); } +/** + * Gets a list of all Search services in the given subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.searchManagementRequestOptions] Additional + * parameters for the operation + * + * @param {uuid} [options.searchManagementRequestOptions.clientRequestId] A + * client-generated GUID value that identifies this request. If specified, this + * will be included in response information as a way to track the request. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SearchServiceListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listBySubscription(options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let searchManagementRequestOptions = (options && options.searchManagementRequestOptions !== undefined) ? options.searchManagementRequestOptions : undefined; + // Validate + try { + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + let clientRequestId; + try { + if (searchManagementRequestOptions !== null && searchManagementRequestOptions !== undefined) { + clientRequestId = searchManagementRequestOptions.clientRequestId; + if (clientRequestId !== null && clientRequestId !== undefined && !(typeof clientRequestId.valueOf() === 'string' && msRest.isValidUuid(clientRequestId))) { + throw new Error('clientRequestId must be of type string and must be a valid uuid.'); + } + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Search/searchServices'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if (clientRequestId !== undefined && clientRequestId !== null) { + httpRequest.headers['x-ms-client-request-id'] = clientRequestId.toString(); + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SearchServiceListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + /** * 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 @@ -937,15 +1089,13 @@ function _checkNameAvailability(name, options, callback) { let clientRequestId; let checkNameAvailabilityInput = new client.models['CheckNameAvailabilityInput'](); try { - if (searchManagementRequestOptions !== null && searchManagementRequestOptions !== undefined) - { + if (searchManagementRequestOptions !== null && searchManagementRequestOptions !== undefined) { clientRequestId = searchManagementRequestOptions.clientRequestId; if (clientRequestId !== null && clientRequestId !== undefined && !(typeof clientRequestId.valueOf() === 'string' && msRest.isValidUuid(clientRequestId))) { throw new Error('clientRequestId must be of type string and must be a valid uuid.'); } } - if (name !== null && name !== undefined) - { + if (name !== null && name !== undefined) { checkNameAvailabilityInput.name = name; } } catch (error) { @@ -1176,8 +1326,7 @@ function _beginCreateOrUpdate(resourceGroupName, searchServiceName, service, opt } let clientRequestId; try { - if (searchManagementRequestOptions !== null && searchManagementRequestOptions !== undefined) - { + if (searchManagementRequestOptions !== null && searchManagementRequestOptions !== undefined) { clientRequestId = searchManagementRequestOptions.clientRequestId; if (clientRequestId !== null && clientRequestId !== undefined && !(typeof clientRequestId.valueOf() === 'string' && msRest.isValidUuid(clientRequestId))) { throw new Error('clientRequestId must be of type string and must be a valid uuid.'); @@ -1323,6 +1472,7 @@ class Services { this._get = _get; this._deleteMethod = _deleteMethod; this._listByResourceGroup = _listByResourceGroup; + this._listBySubscription = _listBySubscription; this._checkNameAvailability = _checkNameAvailability; this._beginCreateOrUpdate = _beginCreateOrUpdate; } @@ -2033,6 +2183,99 @@ class Services { } } + /** + * Gets a list of all Search services in the given subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.searchManagementRequestOptions] Additional + * parameters for the operation + * + * @param {uuid} [options.searchManagementRequestOptions.clientRequestId] A + * client-generated GUID value that identifies this request. If specified, this + * will be included in response information as a way to track the request. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listBySubscriptionWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listBySubscription(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a list of all Search services in the given subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.searchManagementRequestOptions] Additional + * parameters for the operation + * + * @param {uuid} [options.searchManagementRequestOptions.clientRequestId] A + * client-generated GUID value that identifies this request. If specified, this + * will be included in response information as a way to track the request. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {SearchServiceListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SearchServiceListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listBySubscription(options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listBySubscription(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listBySubscription(options, optionalCallback); + } + } + /** * 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 diff --git a/lib/services/searchManagement/lib/searchManagementClient.d.ts b/lib/services/searchManagement/lib/searchManagementClient.d.ts index 04051527d8..c9132af87b 100644 --- a/lib/services/searchManagement/lib/searchManagementClient.d.ts +++ b/lib/services/searchManagement/lib/searchManagementClient.d.ts @@ -34,11 +34,11 @@ export default class SearchManagementClient extends AzureServiceClient { * * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy * - * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. + * @param {string} [options.acceptLanguage] - The preferred language for the response. * - * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * @param {number} [options.longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30. * - * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. * */ constructor(credentials: ServiceClientCredentials, subscriptionId: string, baseUri?: string, options?: AzureServiceClientOptions); diff --git a/lib/services/searchManagement/lib/searchManagementClient.js b/lib/services/searchManagement/lib/searchManagementClient.js index 8c147de773..20e6d15026 100644 --- a/lib/services/searchManagement/lib/searchManagementClient.js +++ b/lib/services/searchManagement/lib/searchManagementClient.js @@ -34,9 +34,9 @@ class SearchManagementClient extends ServiceClient { * @param {object} [options.requestOptions] - Options for the underlying request object * {@link https://github.com/request/request#requestoptions-callback Options doc} * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy - * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. - * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. - * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * @param {string} [options.acceptLanguage] - The preferred language for the response. + * @param {number} [options.longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30. + * @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ constructor(credentials, subscriptionId, baseUri, options) { if (credentials === null || credentials === undefined) { diff --git a/lib/services/searchManagement/package.json b/lib/services/searchManagement/package.json index 34ce5a00c4..8543714ab9 100644 --- a/lib/services/searchManagement/package.json +++ b/lib/services/searchManagement/package.json @@ -14,12 +14,12 @@ "license": "MIT", "main": "./lib/searchManagementClient.js", "types": "./lib/searchManagementClient.d.ts", - "homepage": "http://github.com/azure/azure-sdk-for-node", + "homepage": "https://github.com/azure/azure-sdk-for-node/tree/master/lib/services/searchManagement", "repository": { "type": "git", "url": "https://github.com/azure/azure-sdk-for-node.git" }, "bugs": { - "url": "http://github.com/Azure/azure-sdk-for-node/issues" + "url": "https://github.com/azure/azure-sdk-for-node/issues" } -} \ No newline at end of file +}