diff --git a/sdk/operationalinsights/arm-operationalinsights/package.json b/sdk/operationalinsights/arm-operationalinsights/package.json index 7c0ab0ee610a..e05f38ed0b65 100644 --- a/sdk/operationalinsights/arm-operationalinsights/package.json +++ b/sdk/operationalinsights/arm-operationalinsights/package.json @@ -2,7 +2,7 @@ "name": "@azure/arm-operationalinsights", "author": "Microsoft Corporation", "description": "OperationalInsightsManagementClient Library with typescript type definitions for node.js and browser.", - "version": "2.0.0", + "version": "3.0.0", "dependencies": { "@azure/ms-rest-azure-js": "^2.0.1", "@azure/ms-rest-js": "^2.0.4", diff --git a/sdk/operationalinsights/arm-operationalinsights/src/models/index.ts b/sdk/operationalinsights/arm-operationalinsights/src/models/index.ts index 69e1c27dd2f8..53ccc24a692a 100644 --- a/sdk/operationalinsights/arm-operationalinsights/src/models/index.ts +++ b/sdk/operationalinsights/arm-operationalinsights/src/models/index.ts @@ -180,7 +180,7 @@ export interface DataSource extends ProxyResource { /** * The ETag of the data source. */ - eTag?: string; + etag?: string; /** * Possible values include: 'WindowsEvent', 'WindowsPerformanceCounter', 'IISLogs', * 'LinuxSyslog', 'LinuxSyslogCollection', 'LinuxPerformanceObject', @@ -793,7 +793,7 @@ export interface SavedSearch extends ProxyResource { /** * The ETag of the saved search. */ - eTag?: string; + etag?: string; /** * The category of the saved search. This helps the user to find a saved search faster. */ @@ -1477,26 +1477,6 @@ export type DataExportsGetResponse = DataExport & { }; }; -/** - * Contains response data for the beginCreateOrUpdate operation. - */ -export type DataExportsBeginCreateOrUpdateResponse = DataExport & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: DataExport; - }; -}; - /** * Contains response data for the createOrUpdate operation. */ diff --git a/sdk/operationalinsights/arm-operationalinsights/src/models/mappers.ts b/sdk/operationalinsights/arm-operationalinsights/src/models/mappers.ts index 5fed2c074d98..67b33b23c24f 100644 --- a/sdk/operationalinsights/arm-operationalinsights/src/models/mappers.ts +++ b/sdk/operationalinsights/arm-operationalinsights/src/models/mappers.ts @@ -284,8 +284,8 @@ export const DataSource: msRest.CompositeMapper = { name: "Object" } }, - eTag: { - serializedName: "eTag", + etag: { + serializedName: "etag", type: { name: "String" } @@ -1271,8 +1271,8 @@ export const SavedSearch: msRest.CompositeMapper = { className: "SavedSearch", modelProperties: { ...ProxyResource.type.modelProperties, - eTag: { - serializedName: "eTag", + etag: { + serializedName: "etag", type: { name: "String" } diff --git a/sdk/operationalinsights/arm-operationalinsights/src/operationalInsightsManagementClientContext.ts b/sdk/operationalinsights/arm-operationalinsights/src/operationalInsightsManagementClientContext.ts index 891ad39f05bc..7ca0b6769c2e 100644 --- a/sdk/operationalinsights/arm-operationalinsights/src/operationalInsightsManagementClientContext.ts +++ b/sdk/operationalinsights/arm-operationalinsights/src/operationalInsightsManagementClientContext.ts @@ -13,7 +13,7 @@ import * as msRest from "@azure/ms-rest-js"; import * as msRestAzure from "@azure/ms-rest-azure-js"; const packageName = "@azure/arm-operationalinsights"; -const packageVersion = "2.0.0"; +const packageVersion = "3.0.0"; export class OperationalInsightsManagementClientContext extends msRestAzure.AzureServiceClient { credentials: msRest.ServiceClientCredentials; @@ -37,7 +37,7 @@ export class OperationalInsightsManagementClientContext extends msRestAzure.Azur if (!options) { options = {}; } - if (!options.userAgent) { + if(!options.userAgent) { const defaultUserAgent = msRestAzure.getDefaultUserAgentValue(); options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; } @@ -52,10 +52,10 @@ export class OperationalInsightsManagementClientContext extends msRestAzure.Azur this.credentials = credentials; this.subscriptionId = subscriptionId; - if (options.acceptLanguage !== null && options.acceptLanguage !== undefined) { + if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { this.acceptLanguage = options.acceptLanguage; } - if (options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { + if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; } } diff --git a/sdk/operationalinsights/arm-operationalinsights/src/operations/dataExports.ts b/sdk/operationalinsights/arm-operationalinsights/src/operations/dataExports.ts index e12a5d11fbe9..013143c585be 100644 --- a/sdk/operationalinsights/arm-operationalinsights/src/operations/dataExports.ts +++ b/sdk/operationalinsights/arm-operationalinsights/src/operations/dataExports.ts @@ -9,7 +9,6 @@ */ import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; import * as Models from "../models"; import * as Mappers from "../models/dataExportsMappers"; import * as Parameters from "../models/parameters"; @@ -68,9 +67,35 @@ export class DataExports { * @param [options] The optional parameters * @returns Promise */ - createOrUpdate(resourceGroupName: string, workspaceName: string, dataExportName: string, parameters: Models.DataExport, options?: msRest.RequestOptionsBase): Promise { - return this.beginCreateOrUpdate(resourceGroupName,workspaceName,dataExportName,parameters,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + createOrUpdate(resourceGroupName: string, workspaceName: string, dataExportName: string, parameters: Models.DataExport, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataExportName The data export rule name. + * @param parameters The parameters required to create or update a data export. + * @param callback The callback + */ + createOrUpdate(resourceGroupName: string, workspaceName: string, dataExportName: string, parameters: Models.DataExport, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataExportName The data export rule name. + * @param parameters The parameters required to create or update a data export. + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdate(resourceGroupName: string, workspaceName: string, dataExportName: string, parameters: Models.DataExport, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdate(resourceGroupName: string, workspaceName: string, dataExportName: string, parameters: Models.DataExport, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + workspaceName, + dataExportName, + parameters, + options + }, + createOrUpdateOperationSpec, + callback) as Promise; } /** @@ -144,28 +169,6 @@ export class DataExports { deleteMethodOperationSpec, callback); } - - /** - * Create or update a data export. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param dataExportName The data export rule name. - * @param parameters The parameters required to create or update a data export. - * @param [options] The optional parameters - * @returns Promise - */ - beginCreateOrUpdate(resourceGroupName: string, workspaceName: string, dataExportName: string, parameters: Models.DataExport, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - workspaceName, - dataExportName, - parameters, - options - }, - beginCreateOrUpdateOperationSpec, - options); - } } // Operation Specifications @@ -195,14 +198,14 @@ const listByWorkspaceOperationSpec: msRest.OperationSpec = { serializer }; -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", +const createOrUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataExports/{dataExportName}", urlParameters: [ Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.workspaceName, - Parameters.dataExportName1 + Parameters.dataExportName0 ], queryParameters: [ Parameters.apiVersion @@ -210,11 +213,20 @@ const getOperationSpec: msRest.OperationSpec = { headerParameters: [ Parameters.acceptLanguage ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.DataExport, + required: true + } + }, responses: { 200: { bodyMapper: Mappers.DataExport }, - 404: {}, + 201: { + bodyMapper: Mappers.DataExport + }, default: { bodyMapper: Mappers.DataExportErrorResponse } @@ -222,8 +234,8 @@ const getOperationSpec: msRest.OperationSpec = { serializer }; -const deleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataExports/{dataExportName}", urlParameters: [ Parameters.subscriptionId, @@ -238,8 +250,9 @@ const deleteMethodOperationSpec: msRest.OperationSpec = { Parameters.acceptLanguage ], responses: { - 200: {}, - 404: {}, + 200: { + bodyMapper: Mappers.DataExport + }, default: { bodyMapper: Mappers.DataExportErrorResponse } @@ -247,14 +260,14 @@ const deleteMethodOperationSpec: msRest.OperationSpec = { serializer }; -const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", +const deleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataExports/{dataExportName}", urlParameters: [ Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.workspaceName, - Parameters.dataExportName0 + Parameters.dataExportName1 ], queryParameters: [ Parameters.apiVersion @@ -262,20 +275,9 @@ const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { headerParameters: [ Parameters.acceptLanguage ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.DataExport, - required: true - } - }, responses: { - 200: { - bodyMapper: Mappers.DataExport - }, - 201: { - bodyMapper: Mappers.DataExport - }, + 200: {}, + 404: {}, default: { bodyMapper: Mappers.DataExportErrorResponse } diff --git a/sdk/operationalinsights/arm-operationalinsights/src/operations/workspacePurge.ts b/sdk/operationalinsights/arm-operationalinsights/src/operations/workspacePurge.ts index 7d0f2a9ecce8..497567377f50 100644 --- a/sdk/operationalinsights/arm-operationalinsights/src/operations/workspacePurge.ts +++ b/sdk/operationalinsights/arm-operationalinsights/src/operations/workspacePurge.ts @@ -140,7 +140,8 @@ const purgeOperationSpec: msRest.OperationSpec = { headersMapper: Mappers.WorkspacePurgePurgeHeaders }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.CloudError, + headersMapper: Mappers.WorkspacePurgePurgeHeaders } }, serializer