import * as coreClient from "@azure/core-client" ; import * as Parameters from "./models/parameters" ; import * as Mappers from "./models/mappers" ; import { ValidationClientOptionalParams , ValidationOfMethodParametersOptionalParams , ValidationOfMethodParametersResponse , ValidationOfBodyOptionalParams , ValidationOfBodyResponse , GetWithConstantInPathOptionalParams , PostWithConstantInBodyOptionalParams , PostWithConstantInBodyResponse } from "./models" ; export class ValidationClient extends coreClient . ServiceClient { $host : string ; subscriptionId : string ; apiVersion : string ; param subscriptionId param options constructor ( subscriptionId , options ? ) { if ( subscriptionId === undefined ) { throw new Error ( "'subscriptionId' cannot be null" ) ; } if ( ! options ) { options = { } ; } const defaults = { requestContentType : "application/json; charset=utf-8" } ; const packageDetails = `azsdk-js-validation/1.0.0-preview1` ; const userAgentPrefix = options . userAgentOptions && options . userAgentOptions . userAgentPrefix ? `${ options . userAgentOptions . userAgentPrefix } ${ packageDetails }` : `${ packageDetails }` ; const optionsWithDefaults = { ... defaults , ... options , userAgentOptions : { userAgentPrefix } , baseUri : options . endpoint || "http://localhost:3000" } ; super ( optionsWithDefaults ) ; this . subscriptionId = subscriptionId ; this . $host = options . $host || "http://localhost:3000" ; this . apiVersion = options . apiVersion || "1.0.0" ; } param resourceGroupName param id param options validationOfMethodParameters ( resourceGroupName , id , options ? ) { return this . sendOperationRequest ( { resourceGroupName , id , options } , validationOfMethodParametersOperationSpec ) ; } param resourceGroupName param id param options validationOfBody ( resourceGroupName , id , options ? ) { return this . sendOperationRequest ( { resourceGroupName , id , options } , validationOfBodyOperationSpec ) ; } param options getWithConstantInPath ( options ? ) { return this . sendOperationRequest ( { options } , getWithConstantInPathOperationSpec ) ; } param options postWithConstantInBody ( options ? ) { return this . sendOperationRequest ( { options } , postWithConstantInBodyOperationSpec ) ; } } const serializer = coreClient . createSerializer ( Mappers , false ) ; const validationOfMethodParametersOperationSpec = { path : "/fakepath/{subscriptionId}/{resourceGroupName}/{id}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . Product } , default : { bodyMapper : Mappers . ErrorModel } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . subscriptionId , Parameters . resourceGroupName , Parameters . id ] , headerParameters : [ Parameters . accept ] , serializer } ; const validationOfBodyOperationSpec = { path : "/fakepath/{subscriptionId}/{resourceGroupName}/{id}" , httpMethod : "PUT" , responses : { 200 : { bodyMapper : Mappers . Product } , default : { bodyMapper : Mappers . ErrorModel } } , requestBody : Parameters . body , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . subscriptionId , Parameters . id , Parameters . resourceGroupName1 ] , headerParameters : [ Parameters . accept , Parameters . contentType ] , mediaType : "json" , serializer } ; const getWithConstantInPathOperationSpec = { path : "/validation/constantsInPath/{constantParam}/value" , httpMethod : "GET" , responses : { 200 : { } } , urlParameters : [ Parameters . $host , Parameters . constantParam ] , serializer } ; const postWithConstantInBodyOperationSpec = { path : "/validation/constantsInPath/{constantParam}/value" , httpMethod : "POST" , responses : { 200 : { bodyMapper : Mappers . Product } } , requestBody : Parameters . body , urlParameters : [ Parameters . $host , Parameters . constantParam ] , headerParameters : [ Parameters . accept , Parameters . contentType ] , mediaType : "json" , serializer } ;