/* * 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 { ProductSettings } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { SecurityInsights } from "../securityInsights"; import { ProductSettingsListOptionalParams, ProductSettingsListResponse, ProductSettingsGetOptionalParams, ProductSettingsGetResponse, ProductSettingsDeleteOptionalParams, SettingsUnion, ProductSettingsUpdateOptionalParams, ProductSettingsUpdateResponse } from "../models"; /** Class containing ProductSettings operations. */ export class ProductSettingsImpl implements ProductSettings { private readonly client: SecurityInsights; /** * Initialize a new instance of the class ProductSettings class. * @param client Reference to the service client */ constructor(client: SecurityInsights) { this.client = client; } /** * List of all the settings * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param options The options parameters. */ list( resourceGroupName: string, workspaceName: string, options?: ProductSettingsListOptionalParams ): Promise { return this.client.sendOperationRequest( { resourceGroupName, workspaceName, options }, listOperationSpec ); } /** * Gets a setting. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param settingsName The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba * @param options The options parameters. */ get( resourceGroupName: string, workspaceName: string, settingsName: string, options?: ProductSettingsGetOptionalParams ): Promise { return this.client.sendOperationRequest( { resourceGroupName, workspaceName, settingsName, options }, getOperationSpec ); } /** * Delete setting of the product. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param settingsName The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba * @param options The options parameters. */ delete( resourceGroupName: string, workspaceName: string, settingsName: string, options?: ProductSettingsDeleteOptionalParams ): Promise { return this.client.sendOperationRequest( { resourceGroupName, workspaceName, settingsName, options }, deleteOperationSpec ); } /** * Updates setting. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param settingsName The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba * @param settings The setting * @param options The options parameters. */ update( resourceGroupName: string, workspaceName: string, settingsName: string, settings: SettingsUnion, options?: ProductSettingsUpdateOptionalParams ): Promise { return this.client.sendOperationRequest( { resourceGroupName, workspaceName, settingsName, settings, options }, updateOperationSpec ); } } // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const listOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/settings", httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.SettingList }, default: { bodyMapper: Mappers.CloudError } }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.workspaceName ], headerParameters: [Parameters.accept], serializer }; const getOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/settings/{settingsName}", httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.Settings }, default: { bodyMapper: Mappers.CloudError } }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.workspaceName, Parameters.settingsName ], headerParameters: [Parameters.accept], serializer }; const deleteOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/settings/{settingsName}", httpMethod: "DELETE", responses: { 200: {}, 204: {}, default: { bodyMapper: Mappers.CloudError } }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.workspaceName, Parameters.settingsName ], headerParameters: [Parameters.accept], serializer }; const updateOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/settings/{settingsName}", httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.Settings }, default: { bodyMapper: Mappers.CloudError } }, requestBody: Parameters.settings, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.workspaceName, Parameters.settingsName ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", serializer };