import { createSpan } from "../tracing" ; import { Basic } 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 { BasicGetValidOptionalParams , BasicGetValidResponse , BasicDef , BasicPutValidOptionalParams , BasicGetInvalidOptionalParams , BasicGetInvalidResponse , BasicGetEmptyOptionalParams , BasicGetEmptyResponse , BasicGetNullOptionalParams , BasicGetNullResponse , BasicGetNotProvidedOptionalParams , BasicGetNotProvidedResponse } from "../models" ; /** Class containing Basic operations. */ export class BasicImpl implements Basic { private readonly client : BodyComplexWithTracing ; param client constructor ( client ) { this . client = client ; } param options async getValid ( options ? ) { const { span } = createSpan ( "BodyComplexWithTracing-getValid" , options || { } ) ; try { const result = await this . client . sendOperationRequest ( { options } , getValidOperationSpec ) ; return result as BasicGetValidResponse ; } catch ( error ) { span . setStatus ( { code : coreTracing . SpanStatusCode . UNSET , message : error . message } ) ; throw error ; } finally { span . end ( ) ; } } param complexBody param options async putValid ( complexBody , options ? ) { const { span } = createSpan ( "BodyComplexWithTracing-putValid" , options || { } ) ; try { const result = await this . client . sendOperationRequest ( { complexBody , options } , putValidOperationSpec ) ; return result as void ; } catch ( error ) { span . setStatus ( { code : coreTracing . SpanStatusCode . UNSET , message : error . message } ) ; throw error ; } finally { span . end ( ) ; } } param options async getInvalid ( options ? ) { const { span } = createSpan ( "BodyComplexWithTracing-getInvalid" , options || { } ) ; try { const result = await this . client . sendOperationRequest ( { options } , getInvalidOperationSpec ) ; return result as BasicGetInvalidResponse ; } catch ( error ) { span . setStatus ( { code : coreTracing . SpanStatusCode . UNSET , message : error . message } ) ; throw error ; } finally { span . end ( ) ; } } param options async getEmpty ( options ? ) { const { span } = createSpan ( "BodyComplexWithTracing-getEmpty" , options || { } ) ; try { const result = await this . client . sendOperationRequest ( { options } , getEmptyOperationSpec ) ; return result as BasicGetEmptyResponse ; } catch ( error ) { span . setStatus ( { code : coreTracing . SpanStatusCode . UNSET , message : error . message } ) ; throw error ; } finally { span . end ( ) ; } } param options async getNull ( options ? ) { const { span } = createSpan ( "BodyComplexWithTracing-getNull" , options || { } ) ; try { const result = await this . client . sendOperationRequest ( { options } , getNullOperationSpec ) ; return result as BasicGetNullResponse ; } catch ( error ) { span . setStatus ( { code : coreTracing . SpanStatusCode . UNSET , message : error . message } ) ; throw error ; } finally { span . end ( ) ; } } param options async getNotProvided ( options ? ) { const { span } = createSpan ( "BodyComplexWithTracing-getNotProvided" , options || { } ) ; try { const result = await this . client . sendOperationRequest ( { options } , getNotProvidedOperationSpec ) ; return result as BasicGetNotProvidedResponse ; } catch ( error ) { span . setStatus ( { code : coreTracing . SpanStatusCode . UNSET , message : error . message } ) ; throw error ; } finally { span . end ( ) ; } } } const serializer = coreClient . createSerializer ( Mappers , false ) ; const getValidOperationSpec = { path : "/complex/basic/valid" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . BasicDef } , default : { bodyMapper : Mappers . ErrorModel } } , urlParameters : [ Parameters . $host ] , headerParameters : [ Parameters . accept ] , serializer } ; const putValidOperationSpec = { path : "/complex/basic/valid" , httpMethod : "PUT" , responses : { 200 : { } , default : { bodyMapper : Mappers . ErrorModel } } , requestBody : Parameters . complexBody , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host ] , headerParameters : [ Parameters . accept , Parameters . contentType ] , mediaType : "json" , serializer } ; const getInvalidOperationSpec = { path : "/complex/basic/invalid" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . BasicDef } , default : { bodyMapper : Mappers . ErrorModel } } , urlParameters : [ Parameters . $host ] , headerParameters : [ Parameters . accept ] , serializer } ; const getEmptyOperationSpec = { path : "/complex/basic/empty" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . BasicDef } , default : { bodyMapper : Mappers . ErrorModel } } , urlParameters : [ Parameters . $host ] , headerParameters : [ Parameters . accept ] , serializer } ; const getNullOperationSpec = { path : "/complex/basic/null" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . BasicDef } , default : { bodyMapper : Mappers . ErrorModel } } , urlParameters : [ Parameters . $host ] , headerParameters : [ Parameters . accept ] , serializer } ; const getNotProvidedOperationSpec = { path : "/complex/basic/notprovided" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . BasicDef } , default : { bodyMapper : Mappers . ErrorModel } } , urlParameters : [ Parameters . $host ] , headerParameters : [ Parameters . accept ] , serializer } ;