/* * 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 { EntityRelations } 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 { EntityRelationsGetRelationOptionalParams, EntityRelationsGetRelationResponse } from "../models"; /** Class containing EntityRelations operations. */ export class EntityRelationsImpl implements EntityRelations { private readonly client: SecurityInsights; /** * Initialize a new instance of the class EntityRelations class. * @param client Reference to the service client */ constructor(client: SecurityInsights) { this.client = client; } /** * Gets an entity relation. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param entityId entity ID * @param relationName Relation Name * @param options The options parameters. */ getRelation( resourceGroupName: string, workspaceName: string, entityId: string, relationName: string, options?: EntityRelationsGetRelationOptionalParams ): Promise { return this.client.sendOperationRequest( { resourceGroupName, workspaceName, entityId, relationName, options }, getRelationOperationSpec ); } } // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const getRelationOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}/relations/{relationName}", httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.Relation }, default: { bodyMapper: Mappers.CloudError } }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.workspaceName, Parameters.relationName, Parameters.entityId ], headerParameters: [Parameters.accept], serializer };