import { createSpan } from "../tracing" ; import { Primitive } from "../operationsInterfaces" ; import * as coreClient from "@azure/core-client" ; import * as coreTracing from "@azure/core-tracing" ; import * as Mappers from "../models/mappers" ; import * as Parameters from "../models/parameters" ; import { BodyComplexWithTracing } from "../bodyComplexWithTracing" ; import { PrimitiveGetIntOptionalParams , PrimitiveGetIntResponse , IntWrapper , PrimitivePutIntOptionalParams , PrimitiveGetLongOptionalParams , PrimitiveGetLongResponse , LongWrapper , PrimitivePutLongOptionalParams , PrimitiveGetFloatOptionalParams , PrimitiveGetFloatResponse , FloatWrapper , PrimitivePutFloatOptionalParams , PrimitiveGetDoubleOptionalParams , PrimitiveGetDoubleResponse , DoubleWrapper , PrimitivePutDoubleOptionalParams , PrimitiveGetBoolOptionalParams , PrimitiveGetBoolResponse , BooleanWrapper , PrimitivePutBoolOptionalParams , PrimitiveGetStringOptionalParams , PrimitiveGetStringResponse , StringWrapper , PrimitivePutStringOptionalParams , PrimitiveGetDateOptionalParams , PrimitiveGetDateResponse , DateWrapper , PrimitivePutDateOptionalParams , PrimitiveGetDateTimeOptionalParams , PrimitiveGetDateTimeResponse , DatetimeWrapper , PrimitivePutDateTimeOptionalParams , PrimitiveGetDateTimeRfc1123OptionalParams , PrimitiveGetDateTimeRfc1123Response , Datetimerfc1123Wrapper , PrimitivePutDateTimeRfc1123OptionalParams , PrimitiveGetDurationOptionalParams , PrimitiveGetDurationResponse , DurationWrapper , PrimitivePutDurationOptionalParams , PrimitiveGetByteOptionalParams , PrimitiveGetByteResponse , ByteWrapper , PrimitivePutByteOptionalParams } from "../models" ; /** Class containing Primitive operations. */ export class PrimitiveImpl implements Primitive { private readonly client : BodyComplexWithTracing ; param client constructor ( client ) { this . client = client ; } param options async getInt ( options ? ) { const { span } = createSpan ( "BodyComplexWithTracing-getInt" , options || { } ) ; try { const result = await this . client . sendOperationRequest ( { options } , getIntOperationSpec ) ; return result as PrimitiveGetIntResponse ; } catch ( error ) { span . setStatus ( { code : coreTracing . SpanStatusCode . UNSET , message : error . message } ) ; throw error ; } finally { span . end ( ) ; } } param complexBody param options async putInt ( complexBody , options ? ) { const { span } = createSpan ( "BodyComplexWithTracing-putInt" , options || { } ) ; try { const result = await this . client . sendOperationRequest ( { complexBody , options } , putIntOperationSpec ) ; return result as void ; } catch ( error ) { span . setStatus ( { code : coreTracing . SpanStatusCode . UNSET , message : error . message } ) ; throw error ; } finally { span . end ( ) ; } } param options async getLong ( options ? ) { const { span } = createSpan ( "BodyComplexWithTracing-getLong" , options || { } ) ; try { const result = await this . client . sendOperationRequest ( { options } , getLongOperationSpec ) ; return result as PrimitiveGetLongResponse ; } catch ( error ) { span . setStatus ( { code : coreTracing . SpanStatusCode . UNSET , message : error . message } ) ; throw error ; } finally { span . end ( ) ; } } param complexBody param options async putLong ( complexBody , options ? ) { const { span } = createSpan ( "BodyComplexWithTracing-putLong" , options || { } ) ; try { const result = await this . client . sendOperationRequest ( { complexBody , options } , putLongOperationSpec ) ; return result as void ; } catch ( error ) { span . setStatus ( { code : coreTracing . SpanStatusCode . UNSET , message : error . message } ) ; throw error ; } finally { span . end ( ) ; } } param options async getFloat ( options ? ) { const { span } = createSpan ( "BodyComplexWithTracing-getFloat" , options || { } ) ; try { const result = await this . client . sendOperationRequest ( { options } , getFloatOperationSpec ) ; return result as PrimitiveGetFloatResponse ; } catch ( error ) { span . setStatus ( { code : coreTracing . SpanStatusCode . UNSET , message : error . message } ) ; throw error ; } finally { span . end ( ) ; } } param complexBody param options async putFloat ( complexBody , options ? ) { const { span } = createSpan ( "BodyComplexWithTracing-putFloat" , options || { } ) ; try { const result = await this . client . sendOperationRequest ( { complexBody , options } , putFloatOperationSpec ) ; return result as void ; } catch ( error ) { span . setStatus ( { code : coreTracing . SpanStatusCode . UNSET , message : error . message } ) ; throw error ; } finally { span . end ( ) ; } } param options async getDouble ( options ? ) { const { span } = createSpan ( "BodyComplexWithTracing-getDouble" , options || { } ) ; try { const result = await this . client . sendOperationRequest ( { options } , getDoubleOperationSpec ) ; return result as PrimitiveGetDoubleResponse ; } catch ( error ) { span . setStatus ( { code : coreTracing . SpanStatusCode . UNSET , message : error . message } ) ; throw error ; } finally { span . end ( ) ; } } param complexBody param options async putDouble ( complexBody , options ? ) { const { span } = createSpan ( "BodyComplexWithTracing-putDouble" , options || { } ) ; try { const result = await this . client . sendOperationRequest ( { complexBody , options } , putDoubleOperationSpec ) ; return result as void ; } catch ( error ) { span . setStatus ( { code : coreTracing . SpanStatusCode . UNSET , message : error . message } ) ; throw error ; } finally { span . end ( ) ; } } param options async getBool ( options ? ) { const { span } = createSpan ( "BodyComplexWithTracing-getBool" , options || { } ) ; try { const result = await this . client . sendOperationRequest ( { options } , getBoolOperationSpec ) ; return result as PrimitiveGetBoolResponse ; } catch ( error ) { span . setStatus ( { code : coreTracing . SpanStatusCode . UNSET , message : error . message } ) ; throw error ; } finally { span . end ( ) ; } } param complexBody param options async putBool ( complexBody , options ? ) { const { span } = createSpan ( "BodyComplexWithTracing-putBool" , options || { } ) ; try { const result = await this . client . sendOperationRequest ( { complexBody , options } , putBoolOperationSpec ) ; return result as void ; } catch ( error ) { span . setStatus ( { code : coreTracing . SpanStatusCode . UNSET , message : error . message } ) ; throw error ; } finally { span . end ( ) ; } } param options async getString ( options ? ) { const { span } = createSpan ( "BodyComplexWithTracing-getString" , options || { } ) ; try { const result = await this . client . sendOperationRequest ( { options } , getStringOperationSpec ) ; return result as PrimitiveGetStringResponse ; } catch ( error ) { span . setStatus ( { code : coreTracing . SpanStatusCode . UNSET , message : error . message } ) ; throw error ; } finally { span . end ( ) ; } } param complexBody param options async putString ( complexBody , options ? ) { const { span } = createSpan ( "BodyComplexWithTracing-putString" , options || { } ) ; try { const result = await this . client . sendOperationRequest ( { complexBody , options } , putStringOperationSpec ) ; return result as void ; } catch ( error ) { span . setStatus ( { code : coreTracing . SpanStatusCode . UNSET , message : error . message } ) ; throw error ; } finally { span . end ( ) ; } } param options async getDate ( options ? ) { const { span } = createSpan ( "BodyComplexWithTracing-getDate" , options || { } ) ; try { const result = await this . client . sendOperationRequest ( { options } , getDateOperationSpec ) ; return result as PrimitiveGetDateResponse ; } catch ( error ) { span . setStatus ( { code : coreTracing . SpanStatusCode . UNSET , message : error . message } ) ; throw error ; } finally { span . end ( ) ; } } param complexBody param options async putDate ( complexBody , options ? ) { const { span } = createSpan ( "BodyComplexWithTracing-putDate" , options || { } ) ; try { const result = await this . client . sendOperationRequest ( { complexBody , options } , putDateOperationSpec ) ; return result as void ; } catch ( error ) { span . setStatus ( { code : coreTracing . SpanStatusCode . UNSET , message : error . message } ) ; throw error ; } finally { span . end ( ) ; } } param options async getDateTime ( options ? ) { const { span } = createSpan ( "BodyComplexWithTracing-getDateTime" , options || { } ) ; try { const result = await this . client . sendOperationRequest ( { options } , getDateTimeOperationSpec ) ; return result as PrimitiveGetDateTimeResponse ; } catch ( error ) { span . setStatus ( { code : coreTracing . SpanStatusCode . UNSET , message : error . message } ) ; throw error ; } finally { span . end ( ) ; } } param complexBody param options async putDateTime ( complexBody , options ? ) { const { span } = createSpan ( "BodyComplexWithTracing-putDateTime" , options || { } ) ; try { const result = await this . client . sendOperationRequest ( { complexBody , options } , putDateTimeOperationSpec ) ; return result as void ; } catch ( error ) { span . setStatus ( { code : coreTracing . SpanStatusCode . UNSET , message : error . message } ) ; throw error ; } finally { span . end ( ) ; } } param options async getDateTimeRfc1123 ( options ? ) { const { span } = createSpan ( "BodyComplexWithTracing-getDateTimeRfc1123" , options || { } ) ; try { const result = await this . client . sendOperationRequest ( { options } , getDateTimeRfc1123OperationSpec ) ; return result as PrimitiveGetDateTimeRfc1123Response ; } catch ( error ) { span . setStatus ( { code : coreTracing . SpanStatusCode . UNSET , message : error . message } ) ; throw error ; } finally { span . end ( ) ; } } param complexBody param options async putDateTimeRfc1123 ( complexBody , options ? ) { const { span } = createSpan ( "BodyComplexWithTracing-putDateTimeRfc1123" , options || { } ) ; try { const result = await this . client . sendOperationRequest ( { complexBody , options } , putDateTimeRfc1123OperationSpec ) ; return result as void ; } catch ( error ) { span . setStatus ( { code : coreTracing . SpanStatusCode . UNSET , message : error . message } ) ; throw error ; } finally { span . end ( ) ; } } param options async getDuration ( options ? ) { const { span } = createSpan ( "BodyComplexWithTracing-getDuration" , options || { } ) ; try { const result = await this . client . sendOperationRequest ( { options } , getDurationOperationSpec ) ; return result as PrimitiveGetDurationResponse ; } catch ( error ) { span . setStatus ( { code : coreTracing . SpanStatusCode . UNSET , message : error . message } ) ; throw error ; } finally { span . end ( ) ; } } param complexBody param options async putDuration ( complexBody , options ? ) { const { span } = createSpan ( "BodyComplexWithTracing-putDuration" , options || { } ) ; try { const result = await this . client . sendOperationRequest ( { complexBody , options } , putDurationOperationSpec ) ; return result as void ; } catch ( error ) { span . setStatus ( { code : coreTracing . SpanStatusCode . UNSET , message : error . message } ) ; throw error ; } finally { span . end ( ) ; } } param options async getByte ( options ? ) { const { span } = createSpan ( "BodyComplexWithTracing-getByte" , options || { } ) ; try { const result = await this . client . sendOperationRequest ( { options } , getByteOperationSpec ) ; return result as PrimitiveGetByteResponse ; } catch ( error ) { span . setStatus ( { code : coreTracing . SpanStatusCode . UNSET , message : error . message } ) ; throw error ; } finally { span . end ( ) ; } } param complexBody param options async putByte ( complexBody , options ? ) { const { span } = createSpan ( "BodyComplexWithTracing-putByte" , options || { } ) ; try { const result = await this . client . sendOperationRequest ( { complexBody , options } , putByteOperationSpec ) ; return result as void ; } catch ( error ) { span . setStatus ( { code : coreTracing . SpanStatusCode . UNSET , message : error . message } ) ; throw error ; } finally { span . end ( ) ; } } } const serializer = coreClient . createSerializer ( Mappers , false ) ; const getIntOperationSpec = { path : "/complex/primitive/integer" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . IntWrapper } , default : { bodyMapper : Mappers . ErrorModel } } , urlParameters : [ Parameters . $host ] , headerParameters : [ Parameters . accept ] , serializer } ; const putIntOperationSpec = { path : "/complex/primitive/integer" , httpMethod : "PUT" , responses : { 200 : { } , default : { bodyMapper : Mappers . ErrorModel } } , requestBody : Parameters . complexBody1 , urlParameters : [ Parameters . $host ] , headerParameters : [ Parameters . accept , Parameters . contentType ] , mediaType : "json" , serializer } ; const getLongOperationSpec = { path : "/complex/primitive/long" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . LongWrapper } , default : { bodyMapper : Mappers . ErrorModel } } , urlParameters : [ Parameters . $host ] , headerParameters : [ Parameters . accept ] , serializer } ; const putLongOperationSpec = { path : "/complex/primitive/long" , httpMethod : "PUT" , responses : { 200 : { } , default : { bodyMapper : Mappers . ErrorModel } } , requestBody : Parameters . complexBody2 , urlParameters : [ Parameters . $host ] , headerParameters : [ Parameters . accept , Parameters . contentType ] , mediaType : "json" , serializer } ; const getFloatOperationSpec = { path : "/complex/primitive/float" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . FloatWrapper } , default : { bodyMapper : Mappers . ErrorModel } } , urlParameters : [ Parameters . $host ] , headerParameters : [ Parameters . accept ] , serializer } ; const putFloatOperationSpec = { path : "/complex/primitive/float" , httpMethod : "PUT" , responses : { 200 : { } , default : { bodyMapper : Mappers . ErrorModel } } , requestBody : Parameters . complexBody3 , urlParameters : [ Parameters . $host ] , headerParameters : [ Parameters . accept , Parameters . contentType ] , mediaType : "json" , serializer } ; const getDoubleOperationSpec = { path : "/complex/primitive/double" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . DoubleWrapper } , default : { bodyMapper : Mappers . ErrorModel } } , urlParameters : [ Parameters . $host ] , headerParameters : [ Parameters . accept ] , serializer } ; const putDoubleOperationSpec = { path : "/complex/primitive/double" , httpMethod : "PUT" , responses : { 200 : { } , default : { bodyMapper : Mappers . ErrorModel } } , requestBody : Parameters . complexBody4 , urlParameters : [ Parameters . $host ] , headerParameters : [ Parameters . accept , Parameters . contentType ] , mediaType : "json" , serializer } ; const getBoolOperationSpec = { path : "/complex/primitive/bool" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . BooleanWrapper } , default : { bodyMapper : Mappers . ErrorModel } } , urlParameters : [ Parameters . $host ] , headerParameters : [ Parameters . accept ] , serializer } ; const putBoolOperationSpec = { path : "/complex/primitive/bool" , httpMethod : "PUT" , responses : { 200 : { } , default : { bodyMapper : Mappers . ErrorModel } } , requestBody : Parameters . complexBody5 , urlParameters : [ Parameters . $host ] , headerParameters : [ Parameters . accept , Parameters . contentType ] , mediaType : "json" , serializer } ; const getStringOperationSpec = { path : "/complex/primitive/string" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . StringWrapper } , default : { bodyMapper : Mappers . ErrorModel } } , urlParameters : [ Parameters . $host ] , headerParameters : [ Parameters . accept ] , serializer } ; const putStringOperationSpec = { path : "/complex/primitive/string" , httpMethod : "PUT" , responses : { 200 : { } , default : { bodyMapper : Mappers . ErrorModel } } , requestBody : Parameters . complexBody6 , urlParameters : [ Parameters . $host ] , headerParameters : [ Parameters . accept , Parameters . contentType ] , mediaType : "json" , serializer } ; const getDateOperationSpec = { path : "/complex/primitive/date" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . DateWrapper } , default : { bodyMapper : Mappers . ErrorModel } } , urlParameters : [ Parameters . $host ] , headerParameters : [ Parameters . accept ] , serializer } ; const putDateOperationSpec = { path : "/complex/primitive/date" , httpMethod : "PUT" , responses : { 200 : { } , default : { bodyMapper : Mappers . ErrorModel } } , requestBody : Parameters . complexBody7 , urlParameters : [ Parameters . $host ] , headerParameters : [ Parameters . accept , Parameters . contentType ] , mediaType : "json" , serializer } ; const getDateTimeOperationSpec = { path : "/complex/primitive/datetime" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . DatetimeWrapper } , default : { bodyMapper : Mappers . ErrorModel } } , urlParameters : [ Parameters . $host ] , headerParameters : [ Parameters . accept ] , serializer } ; const putDateTimeOperationSpec = { path : "/complex/primitive/datetime" , httpMethod : "PUT" , responses : { 200 : { } , default : { bodyMapper : Mappers . ErrorModel } } , requestBody : Parameters . complexBody8 , urlParameters : [ Parameters . $host ] , headerParameters : [ Parameters . accept , Parameters . contentType ] , mediaType : "json" , serializer } ; const getDateTimeRfc1123OperationSpec = { path : "/complex/primitive/datetimerfc1123" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . Datetimerfc1123Wrapper } , default : { bodyMapper : Mappers . ErrorModel } } , urlParameters : [ Parameters . $host ] , headerParameters : [ Parameters . accept ] , serializer } ; const putDateTimeRfc1123OperationSpec = { path : "/complex/primitive/datetimerfc1123" , httpMethod : "PUT" , responses : { 200 : { } , default : { bodyMapper : Mappers . ErrorModel } } , requestBody : Parameters . complexBody9 , urlParameters : [ Parameters . $host ] , headerParameters : [ Parameters . accept , Parameters . contentType ] , mediaType : "json" , serializer } ; const getDurationOperationSpec = { path : "/complex/primitive/duration" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . DurationWrapper } , default : { bodyMapper : Mappers . ErrorModel } } , urlParameters : [ Parameters . $host ] , headerParameters : [ Parameters . accept ] , serializer } ; const putDurationOperationSpec = { path : "/complex/primitive/duration" , httpMethod : "PUT" , responses : { 200 : { } , default : { bodyMapper : Mappers . ErrorModel } } , requestBody : Parameters . complexBody10 , urlParameters : [ Parameters . $host ] , headerParameters : [ Parameters . accept , Parameters . contentType ] , mediaType : "json" , serializer } ; const getByteOperationSpec = { path : "/complex/primitive/byte" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . ByteWrapper } , default : { bodyMapper : Mappers . ErrorModel } } , urlParameters : [ Parameters . $host ] , headerParameters : [ Parameters . accept ] , serializer } ; const putByteOperationSpec = { path : "/complex/primitive/byte" , httpMethod : "PUT" , responses : { 200 : { } , default : { bodyMapper : Mappers . ErrorModel } } , requestBody : Parameters . complexBody11 , urlParameters : [ Parameters . $host ] , headerParameters : [ Parameters . accept , Parameters . contentType ] , mediaType : "json" , serializer } ;