/* * 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 { PrivateLinkResources } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { HDInsightManagementClient } from "../hDInsightManagementClient"; import { PrivateLinkResourcesListByClusterOptionalParams, PrivateLinkResourcesListByClusterResponse, PrivateLinkResourcesGetOptionalParams, PrivateLinkResourcesGetResponse } from "../models"; /** Class containing PrivateLinkResources operations. */ export class PrivateLinkResourcesImpl implements PrivateLinkResources { private readonly client: HDInsightManagementClient; /** * Initialize a new instance of the class PrivateLinkResources class. * @param client Reference to the service client */ constructor(client: HDInsightManagementClient) { this.client = client; } /** * Lists the private link resources in a HDInsight cluster. * @param resourceGroupName The name of the resource group. * @param clusterName The name of the cluster. * @param options The options parameters. */ listByCluster( resourceGroupName: string, clusterName: string, options?: PrivateLinkResourcesListByClusterOptionalParams ): Promise { return this.client.sendOperationRequest( { resourceGroupName, clusterName, options }, listByClusterOperationSpec ); } /** * Gets the specific private link resource. * @param resourceGroupName The name of the resource group. * @param clusterName The name of the cluster. * @param privateLinkResourceName The name of the private link resource. * @param options The options parameters. */ get( resourceGroupName: string, clusterName: string, privateLinkResourceName: string, options?: PrivateLinkResourcesGetOptionalParams ): Promise { return this.client.sendOperationRequest( { resourceGroupName, clusterName, privateLinkResourceName, options }, getOperationSpec ); } } // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const listByClusterOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/privateLinkResources", httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.PrivateLinkResourceListResult }, default: { bodyMapper: Mappers.ErrorResponse } }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.clusterName ], headerParameters: [Parameters.accept], serializer }; const getOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/privateLinkResources/{privateLinkResourceName}", httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.PrivateLinkResource }, default: { bodyMapper: Mappers.ErrorResponse } }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.clusterName, Parameters.privateLinkResourceName ], headerParameters: [Parameters.accept], serializer };