import { FooApi } from "../operationsInterfaces" ; import * as coreClient from "@azure/core-client" ; import * as coreRestPipeline from "@azure/core-rest-pipeline" ; import * as Parameters from "../models/parameters" ; import { MediaTypesV3Client } from "../mediaTypesV3Client" ; import { FooApiPostSendOnDefault$binaryOptionalParams , FooApiPostSendOnDefault$textOptionalParams , FooApiPostSendOnDefaultResponse , FooApiPostSend$binaryOptionalParams , FooApiPostSend$textOptionalParams , FooApiPostSendResponse } from "../models" ; /** Class containing FooApi operations. */ export class FooApiImpl implements FooApi { private readonly client : MediaTypesV3Client ; param client constructor ( client ) { this . client = client ; } param contentType param data param options postSendOnDefault ( contentType , data , options ? ) ; param contentType param data param options postSendOnDefault ( contentType , data , options ? ) ; param args postSendOnDefault ( ... args ) { let operationSpec ; let operationArguments ; let options ; if ( args [ 0 ] === "application/octet-stream" ) { operationSpec = postSendOnDefault$binaryOperationSpec ; operationArguments = { contentType : args [ 0 ] , data : args [ 1 ] , options : args [ 2 ] } ; options = args [ 2 ] ; } else if ( args [ 0 ] === "text/plain" ) { operationSpec = postSendOnDefault$textOperationSpec ; operationArguments = { contentType : args [ 0 ] , data : args [ 1 ] , options : args [ 2 ] } ; options = args [ 2 ] ; } else { throw new TypeError ( `"contentType" must be a valid value but instead was "${ args [ 0 ] }".` ) ; } operationArguments . options = options || { } ; return this . client . sendOperationRequest ( operationArguments , operationSpec ) ; } param thing param contentType param data param options postSend ( thing , contentType , data , options ? ) ; param thing param contentType param data param options postSend ( thing , contentType , data , options ? ) ; param args postSend ( ... args ) { let operationSpec ; let operationArguments ; let options ; if ( args [ 1 ] === "application/octet-stream" ) { operationSpec = postSend$binaryOperationSpec ; operationArguments = { thing : args [ 0 ] , contentType : args [ 1 ] , data : args [ 2 ] , options : args [ 3 ] } ; options = args [ 3 ] ; } else if ( args [ 1 ] === "text/plain" ) { operationSpec = postSend$textOperationSpec ; operationArguments = { thing : args [ 0 ] , contentType : args [ 1 ] , data : args [ 2 ] , options : args [ 3 ] } ; options = args [ 3 ] ; } else { throw new TypeError ( `"contentType" must be a valid value but instead was "${ args [ 1 ] }".` ) ; } operationArguments . options = options || { } ; return this . client . sendOperationRequest ( operationArguments , operationSpec ) ; } } const serializer = coreClient . createSerializer ( { } , false ) ; const postSendOnDefault$binaryOperationSpec = { path : "/foo/api/v1" , httpMethod : "POST" , responses : { 202 : { } , 400 : { bodyMapper : { type : { name : "String" } } } } , requestBody : Parameters . data1 , queryParameters : [ Parameters . excluded ] , urlParameters : [ Parameters . $host ] , headerParameters : [ Parameters . contentType1 , Parameters . accept1 ] , mediaType : "binary" , serializer } ; const postSendOnDefault$textOperationSpec = { path : "/foo/api/v1" , httpMethod : "POST" , responses : { 202 : { } , 400 : { bodyMapper : { type : { name : "String" } } } } , requestBody : Parameters . data , queryParameters : [ Parameters . excluded ] , urlParameters : [ Parameters . $host ] , headerParameters : [ Parameters . accept , Parameters . contentType2 ] , mediaType : "text" , serializer } ; const postSend$binaryOperationSpec = { path : "/foo/api/v1/things/{thing}" , httpMethod : "POST" , responses : { 202 : { } , 400 : { bodyMapper : { type : { name : "String" } } } } , requestBody : Parameters . data1 , queryParameters : [ Parameters . excluded ] , urlParameters : [ Parameters . $host , Parameters . thing ] , headerParameters : [ Parameters . contentType1 , Parameters . accept1 ] , mediaType : "binary" , serializer } ; const postSend$textOperationSpec = { path : "/foo/api/v1/things/{thing}" , httpMethod : "POST" , responses : { 202 : { } , 400 : { bodyMapper : { type : { name : "String" } } } } , requestBody : Parameters . data , queryParameters : [ Parameters . excluded ] , urlParameters : [ Parameters . $host , Parameters . thing ] , headerParameters : [ Parameters . accept , Parameters . contentType2 ] , mediaType : "text" , serializer } ;