import { Duration } from "../operationsInterfaces" ; import * as coreClient from "@azure/core-client" ; import * as Mappers from "../models/mappers" ; import * as Parameters from "../models/parameters" ; import { BodyDurationClient } from "../bodyDurationClient" ; import { DurationGetNullOptionalParams , DurationGetNullResponse , DurationPutPositiveDurationOptionalParams , DurationGetPositiveDurationOptionalParams , DurationGetPositiveDurationResponse , DurationGetInvalidOptionalParams , DurationGetInvalidResponse } from "../models" ; /** Class containing Duration operations. */ export class DurationImpl implements Duration { private readonly client : BodyDurationClient ; param client constructor ( client ) { this . client = client ; } param options getNull ( options ? ) { return this . client . sendOperationRequest ( { options } , getNullOperationSpec ) ; } param durationBody param options putPositiveDuration ( durationBody , options ? ) { return this . client . sendOperationRequest ( { durationBody , options } , putPositiveDurationOperationSpec ) ; } param options getPositiveDuration ( options ? ) { return this . client . sendOperationRequest ( { options } , getPositiveDurationOperationSpec ) ; } param options getInvalid ( options ? ) { return this . client . sendOperationRequest ( { options } , getInvalidOperationSpec ) ; } } const serializer = coreClient . createSerializer ( Mappers , false ) ; const getNullOperationSpec = { path : "/duration/null" , httpMethod : "GET" , responses : { 200 : { bodyMapper : { type : { name : "TimeSpan" } } } , default : { bodyMapper : Mappers . ErrorModel } } , urlParameters : [ Parameters . $host ] , headerParameters : [ Parameters . accept ] , serializer } ; const putPositiveDurationOperationSpec = { path : "/duration/positiveduration" , httpMethod : "PUT" , responses : { 200 : { } , default : { bodyMapper : Mappers . ErrorModel } } , requestBody : Parameters . durationBody , urlParameters : [ Parameters . $host ] , headerParameters : [ Parameters . accept , Parameters . contentType ] , mediaType : "json" , serializer } ; const getPositiveDurationOperationSpec = { path : "/duration/positiveduration" , httpMethod : "GET" , responses : { 200 : { bodyMapper : { type : { name : "TimeSpan" } } } , default : { bodyMapper : Mappers . ErrorModel } } , urlParameters : [ Parameters . $host ] , headerParameters : [ Parameters . accept ] , serializer } ; const getInvalidOperationSpec = { path : "/duration/invalid" , httpMethod : "GET" , responses : { 200 : { bodyMapper : { type : { name : "TimeSpan" } } } , default : { bodyMapper : Mappers . ErrorModel } } , urlParameters : [ Parameters . $host ] , headerParameters : [ Parameters . accept ] , serializer } ;